以下RuleSet是对的,我试过它根本不需要Executing.i需要帮助...它,s显示错误规则id计算未找到 [英] Is the following RuleSet right,I tried its not at all Executing.i need a help...It,s shows an error rule id calculations not found

查看:125
本文介绍了以下RuleSet是对的,我试过它根本不需要Executing.i需要帮助...它,s显示错误规则id计算未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<rules>
	<variables>
		<variable id="MarketRate">0.000</variable>
		<variable id="SellingRate">0.000</variable>
		<variable id="BuyingRate">0.000</variable>
		<variable id="SettlementRate">0.000</variable>
		<variable id="SurrenderRate">0.000</variable>
	</variables>
  <rule id="Calculations" useinferencing="False">
      <expression>
      </expression>
      <action actionid="Calculations.rates" type="run">
        <match>
        </match>
        <assign>
        </assign>
      </action>
    </rule>
	<rule id="Calculations.rates" useinterfacing="False">
	<expression>True</expression>
		<actions>
			<action id="SellingRate" type="var">
				<match> CYname=AUD and CYname=CAD and CYname=EUR </match>
				<assign>(Marketrate + 0.15 ) </assign>
			</action>
			<action id="SellingRate" type="var">
				<match> CYname=AED and CYname=CNY and CYname=SEK and CYname=SGD   </match>
				<assign>Marketrate </assign>
			</action>
			<action id="SellingRate" type="var">
				<match> CYname=GBP  </match>
				<assign>(Marketrate + 0.20 ) </assign>
			</action>
			<action id="SellingRate" type="var">
				<match> CYname=JPY </match>
				<assign>(Marketrate + 0.002 ) </assign>
			</action>
			<action id="SellingRate" type="var">
				<match> CYname=USD </match>
				<assign>(Marketrate + 0.04 ) </assign>
			</action>

			<action id="BuyingRate" type="var">
				<match> CYname=AUD and CYname=CAD and CYname=EUR </match>
				<assign>(Marketrate + 0.15 ) </assign>
			</action>
			<action id="BuyingRate" type="var">
				<match> CYname=AED and CYname=CNY and CYname=SEK and CYname=SGD   </match>
				<assign>Marketrate </assign>
			</action>
			<action id="BuyingRate" type="var">
				<match> CYname=GBP  </match>
				<assign>(Marketrate + 0.20 ) </assign>
			</action>
			<action id="BuyingRate" type="var">
				<match> CYname=JPY </match>
				<assign>(Marketrate + 0.002 ) </assign>
			</action>
			<action id="BuyingRate" type="var">
				<match> CYname=USD </match>
				<assign>(Marketrate + 0.04 ) </assign>
			</action>


			<action id="SettlementRate" type="var">
				<match> CYname=AUD and CYname=CAD and CYname=EUR </match>
				<assign>(Marketrate + 0.15 ) </assign>
			</action>
			<action id="SettlementRate" type="var">
				<match> CYname=AED and CYname=CNY and CYname=SEK and CYname=SGD   </match>
				<assign>(Marketrate+(Marketrate * 0.25 /100 ) ) </assign>
			</action>
			<action id="SettlementRate" type="var">
				<match> CYname=GBP  </match>
				<assign>(Marketrate + 0.20 ) </assign>
			</action>
			<action id="SettlementRate" type="var">
				<match> CYname=JPY </match>
				<assign>(Marketrate + 0.002 ) </assign>
			</action>
			<action id="SettlementRate" type="var">
				<match> CYname=USD </match>
				<assign>(Marketrate + 0.05 ) </assign>
			</action>

			

			<action id="SurrenderRate" type="var">
				<match> CYname=AUD and CYname=CAD and CYname=EUR </match>
				<assign>(Marketrate + 0.15 ) </assign>
			</action>
			<action id="SurrenderRate" type="var">
				<match> CYname=AED and CYname=CNY and CYname=SEK and CYname=SGD   </match>
				<assign>Marketrate </assign>
			</action>
			<action id="SurrenderRate" type="var">
				<match> CYname=GBP  </match>
				<assign>(Marketrate + 0.20 ) </assign>
			</action>
			<action id="SurrenderRate" type="var">
				<match> CYname=JPY </match>
				<assign>(Marketrate + 0.002 ) </assign>
			</action>
			<action id="SurrenderRate" type="var">
				<match> CYname=USD </match>
				<assign>(Marketrate + 0.04 ) </assign>
			</action>
		</actions>
	</rule>
  <!--<triggers>
    <trigger id="TriggerOne" varid="Marketrate" ruleid="Calculations" />
  </triggers>-->
</rules>





---------------------------------

前端





---------------------------------
In front end

Dim CYname As New Variable("CYname", currencyname)
            rulesEngine.AddVariable(CYname)
            Dim Marketrate As New Variable("Marketrate", txtmarketrate.Text)
            rulesEngine.AddVariable(Marketrate)
            rulesEngine.RunRule("Calculations")
            displaydata()

I got an error 'Jaxlab.Rules.RuleNotFound Exception' in this line rulesEngine.RunRule("Calculations")

and i refered the project "<a href="http://www.codeproject.com/Articles/15122/Using-a-Rules-Engine-to-Separate-Business-Rules-fr">Using a Rules Engine to Separate Business Rules from the Application</a>[<a href="http://www.codeproject.com/Articles/15122/Using-a-Rules-Engine-to-Separate-Business-Rules-fr" target="_blank" title="New Window">^</a>]"

Please any one help me.

Thanks & Regardsd,
Kani

推荐答案

您再次发布了一个问题,但没有对您自己的代码进行适当的调查。
$ b $b And you have also not provided much information for us to investigate the same.



Please try to debug the code and find out exactly why it is not getting the result as expected.

Check if you get any exceptions or not.

Also don't forget to mention the resource/link/article you followed to achieve this and where is the problem exactly.



I have suggested you in my previous answer[^] to ask the author of the article if it related to that. You will get much better support.



Good Luck.
You again posted one question without proper investigations on your own code.
And you have also not provided much information for us to investigate the same.

Please try to debug the code and find out exactly why it is not getting the result as expected.
Check if you get any exceptions or not.
Also don't forget to mention the resource/link/article you followed to achieve this and where is the problem exactly.

I have suggested you in my previous answer[^] to ask the author of the article if it related to that. You will get much better support.

Good Luck.


这篇关于以下RuleSet是对的,我试过它根本不需要Executing.i需要帮助...它,s显示错误规则id计算未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆