title: Associations and the Grails webflow
body: <p>it's my first time using webflows in Grails and I can't seem to solve this.</p>
  
  <p>I have 3 domain classes with associations that look something like this:</p>
  
  <pre><code>class A {
    ...
    static hasMany = [ b : B ]
    ...
  }
  
  class B {
    ...
    static belongsTo = [ a : A ]
    static hasMany = [ c : C ]
    ...
  }
  
  class C {
    ...
    static belongsTo = [ b : B ]
    ...
  }
  </code></pre>
  
  <p>Now, the GSP communicates with the controller via Javascript (due to my use of Dojo). When I try to remoteFunction a normal action, I can do something like this:</p>
  
  <pre><code>def action1 = {
     def anId = params.id
     def currA = A.get(anId)
     def sample = currA.b?.c // I can get all the way to 'c' without any problems
     ...
  }
  </code></pre>
  
  <p>However, I have a webflow and the contents of that action is in the webflow... It looks something like this:</p>
  
  <pre><code>def someFlow = {
     ...
     someState {
        on("next") {
           def anId = params.id // this does NOT return a null value
           def currA = A.get(anId) // this does NOT return a null value
           def sample = currA.b // error already occurs here and I need to get 'c'!
        }.to("somePage")
        ...
     }
     ...
  }
  </code></pre>
  
  <p>In this case, it tells me that b doesn't exist... so I can't even get to 'c'. Any suggestions on what to do???
  Thanks... getting real desperate...</p>