<div>Hi all,</div>
<div> </div>
<div>first of all, i appologise if i&#39;m starting a topic that already exists (but i couldn&#39;t find one :-)</div>
<div> </div>
<div>i&#39;m having some difficulties with creating test scenarios in guvnor when the domain model is based on referenced objects.</div>
<div> </div>
<div>Suppose we have a model like this one:</div>
<div> </div>
<div>Class Role with attributes:</div>
<div> </div>
<div>   roleId: Long</div>
<div>   roleName: String</div>
<div> </div>
<div>Class User with attributes:</div>
<div> </div>
<div>   userId: Long</div>
<div>   userName: String</div>
<div>   firstName: String</div>
<div>   lastName: String</div>
<div>   role: Role</div>
<div> </div>
<div>Then, lets suppose the rule like this one (it&#39;s pritty simple one)</div>
<div> </div>
<div>rule &quot;my first rule&quot;</div>
<div>dialect &quot;mvel&quot;</div>
<div>when</div>
<div>       usr: User(firstName==&quot;John&quot;, lastName=&quot;Doe&quot;, role.roleName=&quot;ADMIN&quot; )</div>
<div>then</div>
<div>       usr.userName=&quot;ADMIN&quot;</div>
<div>end</div>
<div> </div>
<div>Now, i&#39;m trying to create a test scenario for this rule. And my nightmare begins...</div>
<div> </div>
<div>Seems to me that there is no possibility to define referenced object in test scenario, ie:</div>
<div> </div>
<div>GIVEN </div>
<div>           User [usr]</div>
<div>                  firstName = &quot;...&quot;</div>
<div>                  lastName = &quot;...&quot;</div>
<div>                  <strong><font color="#ff0000">role.roleName = &quot;...&quot;</font></strong></div>
<div> </div>
<div>EXPECTING</div>
<div>..............</div>
<div> </div>
<div>Hope that you can understand what i&#39;m talking about. Can somebody (pretty please) give me some directions how to achieve something like this in test scenarios.</div>
<div> </div>
<div>Thank you for your answers and suggestions (if any) :-))</div>
<div> </div>
<div> </div>
<div> </div>