[rules-users] Variable assignment in DSL

Shyam, Pallav (MSCIBARRA) Pallav.Shyam at mscibarra.com
Wed Sep 3 10:02:28 EDT 2008


I have a DSL

[condition][]There is a Volume where {constraints}=v : RawVolumeTs (
where {constraints} )
[condition][]where {attr} is "{value}"={attr} == "{value}"
[condition][]and {attr} is "{value}"=, {attr} == "{value}"


And here is my business rule using the above dsl(the dslr file)

dialect "java" 

expander volume.dsl

rule "RT(2) against FT(32)"
	when
		There is a Volume where status is "NA"  and sourceId is
"ABC"
		There is a Volume where status is "NA"  and sourceId is
"XYZ"
	then
end	


And here is the translated DRL

dialect "java" 



rule "RT(2) against FT(32)"
	when
	v : RawVolumeTs (status == "NA", sourceId == "ABC")
	v : RawVolumeTs (status == "NA", sourceId == "XYZ")
	then
End


In the above example both the instances of RawVolumeTs as assigned to
variable v.

How do I write a dsl that each of these RawVolumeTs instances get
assigned to different variables.

For example:

The first statement -- There is a Volume where status is "NA"  and
sourceId is "ABC" -- should assign it to variable V1
And the second statement -- There is a Volume where status is "NA"  and
sourceId is "XYZ" -- should assign it to variable V2.


Pallav
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.




More information about the rules-users mailing list