Reply To: Model Snippet of the Day

homepage Forums Executable UML and xtUML Methodology Model Snippet of the Day Reply To: Model Snippet of the Day

#5420
john
Participant

I tried to do it in python:
[code title=”model_snippet.py”]
from xtuml import relate
from xtuml import where_eq as where

from components import community

me = community.select_any(‘attendee’, where(name=’john’))
conf = community.select_any(‘conference’,
where(name=’xtUML 2015′,
date=’December 7 and 8′,
location=’Lafayette, IN’))

relate(me, conf, 1, ‘is going’)
[/code]

but I ran into some trouble:

[code title=”stdout”]
Traceback (most recent call last):
File “model_snippet.py”, line 12, in <module>
relate(me, conf, 1, ‘is going’)
ModelException: Unable to attend conference: its location is to far away.
[/code]

:)