Using personal income tax calculation as the business prototype, the expression rules and the Excel template of the Decision Table are imported. It reflects the text editing of business rules and implements business logic quickly.
Create rule set
Right-click the project "test XML structure" and select "new rule package" to add a rule package named "Calculate personal income tax". The creation process is shown in:
650) this. width = 650; "src =" http://img.blog.csdn.net/20130916133957156 "style =" border: none; color: #333333; font-family: arial; font-size: 14px; line-height: 26px; background-color: # ffffff; "alt=" 20130916133957156 "/>
Create a variable ,:
650) this. width = 650; "src ="/e/u/themes/default/images/spacer.gif "style =" border: 1px solid # ddd; "alt =" spacer.gif "/> 650) this. width = 650; "src =" http://img.blog.csdn.net/20130916134112968 "style =" border: none; color: #333333; font-family: arial; font-size: 14px; line-height: 26px; background-color: # ffffff; "alt=" 20130916134112968 "/>
Create and edit expression rules
Select the "Calculate personal income tax" rule package, right-click to create "add expression rule", and name it "total monthly tax payable ". As shown in:
650) this. width = 650; "src =" http://img.blog.csdn.net/20130916134203218 "style =" border: none; "alt =" 20130916134203218 "/>
650) this. width = 650; "src =" http://img.blog.csdn.net/20130916134152046 "style =" border: none; "alt =" 20130916134152046 "/>
Write the business rules in the edit box on the right. "If", "then", and "end if" are keywords. Blue is the defined variable. The specific content is shown in:
650) this. width = 650; "src =" http://img.blog.csdn.net/20130916134244859 "style =" border: none; color: #333333; font-family: arial; font-size: 14px; line-height: 26px; background-color: # ffffff; "alt=" 20130916134244859 "/>
Table creation and content Import
Add an association decision table and name it "set tax rate ",:
650) this. width = 650; "src =" http://img.blog.csdn.net/20130916134752093 "style =" border: none; "alt =" 20130916134752093 "/>
Prepared Excel template.
650) this. width = 650; "src =" http://img.blog.csdn.net/20130916134904031 "style =" border: none; "alt =" 20130916134904031 "/>
Operation: Import Excel
650) this. width = 650; "src =" http://img.blog.csdn.net/20130916134943375 "style =" border: none; "alt =" 20130916134943375 "/>
After the data is imported, the Excel content appears in the associated decision table. To modify the content in the decision table, you can directly modify the content in the Decision Table and re-import it in Excel.
650) this. width = 650; "src =" http://img.blog.csdn.net/20130916134952781 "style =" border: none; color: #333333; font-family: arial; font-size: 14px; line-height: 26px; background-color: # ffffff; "alt=" 20130916134952781 "/>
Create and compile a post-tax wage expression
Create the "after-tax salary" expression rule and write the content, as shown in.
650) this. width = 650; "src =" http://img.blog.csdn.net/20130916135128062 "style =" border: none; color: #333333; font-family: arial; font-size: 14px; line-height: 26px; background-color: # ffffff; "alt=" 20130916135128062 "/>
650) this. width = 650; "src =" http://img.blog.csdn.net/20130916135200625 "style =" border: none; "alt =" 20130916135200625 "/>
Save, compile, and test 650) this. width = 650; "src =" http://img.blog.csdn.net/20130916135341156 "style =" border: none; color: #333333; font-family: arial; font-size: 14px; line-height: 26px; background-color: # ffffff; "alt=" 20130916135341156 "/>
650) this. width = 650; "src =" http://img.blog.csdn.net/20130916135327109 "style =" border: none; "alt =" 20130916135327109 "/>