Rule introduction nxbre document minutes-Introduction to stream introduction (1)

Source: Internet
Author: User
As Program Let's go straight to the topic and see how the streaming workflow works. At least we have a general understanding.
    1. Load the rule into the streaming
    2. Set some variables used in the Rule File
    3. Execute the rule and save the execution result in context)

Let's take a look at the composition of the streaming rule file.
The rule file is defined in XML. The rule file consists of the following three parts:

    • Rules
    • Logic tests
    • Structure

according to my current understanding, this rule file can define variables.

code highlighting produced by actipro codehighlighter (freeware)
http://www.CodeHighlighter.com/

--> integer id =" 10i " value =" 10 " />
integer id =" 40i " value =" 40 " />

equivalent

code highlighting produced by actipro codehighlighter (freeware)
http://www.CodeHighlighter.com/

--> int 10i = 10 ;< br> int 40i = 40 ;

You can also reference external variables.

code highlighting produced by actipro codehighlighter (freeware)
http://www.CodeHighlighter.com/

--> objectlookup id =" quantityordered " objectid =" currentorder " member =" " />

Equivalent //The premise is that currentorder has been added to the context as an instance of a class. Of course, it is of a weak type.
ObjectQuantityordered=Currentorder. quantityordered;

Logical Block < Logic >
< If >
< And >
< Greaterthan Leftid = "Quantityordered" Rightid = "40i" />
</ And >
< Do >
< Evaluate ID = "Applieddiscount" >
< Parameter Name = "Percent" Value = ". 9" />
</ Evaluate >
</ Do >
</ If >
< Else >
< Evaluate ID = "Applieddiscount" >
< Parameter Name = "Percent" Value = "1" />
</ Evaluate >
</ Else >
</ Logic >

Pseudo code is If (Quantityordered > 40i)
{
Percent= 0.9;//It can be accessed by a program other than the rule, which is the result of rule execution.
}
Else
{
Percent= 1;
}

The implementation of stream pilot basically defines and uses the interface reasonably. Let's take a look at these important interfaces.

Process Method, needless to say, the most important thing is to execute the rule switch.
Not to mention the rulecontext attribute. All variables in the Rule definition file, referenced external variables, and even execution results are stored here.

namespace nxbre. flowengine. Rules description
decrement * auto-minus integer
exception throw an exception
false, true
fatalexception major exception
increment auto-incrementing integer
incrementinit * incrementor or decrementor reset.
objectlookup class or instance mapped to rulecontext through reflection
value any type of variable

Ah, this form is really not neat. Make it together. Although it is ugly, it is in line with your own artist performance...

I don't need to comment on the above. I know what it means literally. I would like to emphasize that the support of regular expressions will leave a huge space for expansion.

These things are used when loading rule files. For example, xbre files must use xbusinessrulesfiledriver.


Factory to create an iflowengine instance

Okay, I said a bunch of things. It seems useless...
At least let me know what this is.

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.