The end result looks like this. I use the NxBRE native format for my rule files instead of ruleML (my comments are in bold):
<xbusinessrules nonamespaceschemalocation="xBusinessRules.xsd" xsi="http://www.w3.org/2001/XMLSchema-instance">
<set id="sMain">
<true id="sMain">
<invokeset id="sP_EXEMPT">
<invokeset id="sP_ACTIVE">
<invokeset id="sP_LOCATION">
<invokeset id="sp_illaccr">
<invokeset id="sp_illtaken">
<invokeset id="sp_vacaccr">
</set>
<set id="sP_EXEMPT">
...some variables I needed for this set of logic;
<string id="Ys" value="Y">
<string id="1s" value="1">
<string id="0s" value="0">
<objectlookup id="oP_EXEMPT" objectid="AbraData" member="P_EXEMPT">
<logic>
...put your if statement here with all the do's and elseif's and other stuff
</logic>
</set>
<!--Convert P_Active from text to integer-->
<set id="sP_ACTIVE">
...some variables I needed for this set of logic;
<string id="As" value="A">
<objectlookup id="oP_ACTIVE" objectid="AbraData" member="P_ACTIVE">
<logic>
...put your if statement here with all the do's and elseif's and other stuff
</logic>
</set>
<!--Check for Null location
This rule in place to prevent import failure due to missed field entry in ABRA application-->
<set id="sP_LOCATION">
...some variables I needed for this set of logic
<objectlookup id="oP_LOCATION" objectid="AbraData" member="P_LOCATION">
<objectlookup id="LocationParse" type="System.Int32" member="TryParse">
<argument valueid="oP_LOCATION">
<argument value="-1" type="Integer">
</objectlookup>
<logic>
...put your if statement here with all the do's and elseif's and other stuff
</logic>
</set>
<!--Check for null value in p_illaccr
This rule may be removed after complete migration to system-->
<set id="sp_illaccr">
...some variables I needed for this set of logic;
<string id="As" value="A">
<objectlookup id="op_illaccr" objectid="AbraData" member="p_illaccr">
<logic>
...put your if statement here with all the do's and elseif's and other stuff
</logic>
</set>
<!--Check for null value in p_illtaken
This rule may be removed after complete migration to system-->
<set id="sp_illtaken">
...some variables I needed for this set of logic;
<string id="As" value="A">
<objectlookup id="op_illtaken" objectid="AbraData" member="p_illtaken">
<logic>
...put your if statement here with all the do's and elseif's and other stuff
</logic>
</set>
<!--Check for null value in p_vacaccr
This rule may be removed after complete migration to system-->
<set id="sp_vacaccr">
...some variables I needed for this set of logic
<string id="As" value="A">
<objectlookup id="op_vacaccr" objectid="AbraData" member="p_vacaccr">
<logic>
...put your if statement here with all the do's and elseif's and other stuff
</logic>
</set>
</xbusinessrules>
I'll post more real world scenarios with snippets of code as we go on.
0 comments:
Post a Comment