using session variable in derived entity property causes compilation error

entity City {
  name :: String := if(language.isEnglish) ename else aname
  ename :: String
  aname :: String
}

session language{
  english :: Bool
  isEnglish :: Bool := english
}

error:

   [javac] 1. ERROR in /Users/dan/workspace/sas/.servletapp/src-generated/webdsl/generated/domain/City.java (at line 127)
   [javac] 	Language language = (Language)env.getVariable("language");
   [javac] 	                              ^^^
   [javac] env cannot be resolved

workaround:

put session var access in an entity method:

entity City {
  name :: String := getName() //if(language.isEnglish) ename else aname
  function getName():String{ return if(language.isEnglish) ename else aname;}
  ename :: String
  aname :: String
}
Submitted by Danny Groenewegen on 28 June 2011 at 13:40

On 22 March 2013 at 13:11 Elmer van Chastelet tagged session

Log in to post comments