title: What's in scope inside a BizTalk Expression shape?
body: <p>Inside a BizTalk Expression shape, I'm presented a blank text editor with some crude "examples" above, mocking me. "It's so easy" they chant. Try as I might, I'm just not making the connection. Maybe I'm over thinking it. I'm a BizTalk newbie. Coming from many years of heavy .NET and software engineering experience, my think doesn't seem to brain...</p>
  
  <p>Would someone with great BizTalk experience enlighten me on this question: What is in scope and available for use inside the Expression shape? And subsequently, the MessageAssignment shape as well?</p>
  
  <p>By scope, I mean like in real programming: Variable names, namespaces, etc.</p>
  
  <p>Every example I see on BizTalk assumes you understand where these things come from. For instance, see this MSDN page: <a href="https://msdn.microsoft.com/en-us/library/aa559259.aspx" rel="nofollow">Using Distinguished Fields and Property Fields</a></p>
  
  <p>It assumes I know where "MyMessage" is created, instanced, and accessible. I have no clue where to initialize it, what shape identifier to give a name, etc.</p>
  
  <p>My design seems simple: When an error occurs, catch it, create an ErrorMessage out of thin air, assign string value to a distinguished field "Reason", and send to a send port. I can get everything but the expression right.</p>
  
  <p>Any expert insight is greatly appreciated.</p>