<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
For your problem of different instances of a map : If you want to
match 2 maps, and compare them, your have to set a placeholder in
your DSL to set the variable's name<br>
<tt>[when]The property {key:ENUM:Map.properties} of the map <b>{mapVar}</b>
is {value}=<b>{mapVar} </b>: Map((this["{key}"] == "{value}"))</tt><br>
<br>
<b> </b>And another DSL phrase to check that instances are
different<br>
<tt>[when]The map <b>{mapVar1}</b> is not map </tt><tt><b>{mapVar2}</b></tt><tt>
=<b> eval ({mapVar1}</b>["id"] != </tt><tt><b>{mapVar2}</b>["id"]</tt><tt>))</tt><b><br>
</b><br>
But it will force your users to handle variables. I can't see
simpler way for doing that with DSL.<br>
<br>
You may consider completely another way. If your property lists are
constant (and they are because you can create static enums), you can
write a simple program to generate the corresponding POJOs (which
contains the map inside them and use it in set/get methods for
corresponding key) and create a jar with them. <br>
Each POJO will then have its fields listed automatically in Guided
Editor, which will prevent you for writing complex DSL and enums,
and provide a good way for users to edit rules. For instance, you
can bind an object to a variable only if you need it (with DSL you
are forced to bind a variable at each time you use the phrase), and
you can use other operator (not only equals) without writing a new
DSL phrase.<br>
<br>
<br>
I did not understand this question :<br>
<br>
<blockquote
cite="mid:AANLkTinGDk7Jk634QwBC4aMquVUX12fKYEVMzjbBNEm+@mail.gmail.com"
type="cite">I have to put my rules in 4 drl files separate (i know
which rules go in which drl file), is the only way to create a
different package for each drl file i want? And to put the Enum
and DSL part in Global if i have to use it for the 4 files? If i
want a precise name for my drl file, i have to give this exact
name to the package?<br>
</blockquote>
But yes, a DSL (and enums) is specific to its package.<br>
<br>
</body>
</html>