Message Assignment shapes and Expression shapes are, at a glance pretty similar. Both allow you to run C# code to manipulate mesages. However there are fundamental differences.
Assignment Shape
The assignment shape lets you create new messages and assign values to its promoted properties. It can only exist inside a Message Construction shape and can only create the message specificed by the construction shape. To ensure that it creates that message and only that message, complex control flow such as if statements are not allowed - however the IDE isn't going to tell you that so if you include an if statement you won't see an error until build time.
Expression Shape
The expression shape lets you manipulate the properties of existing messages as long as they have already been constructed. However it won't let you construct new messages and won't let you manipulate promoted properties so you can't put this shape inside a Message Construction shape. The one upside of this shape is that you can put complex flow logic into the expression shape.
This type of behaviour leads to visually more complex orchestrations but actually ensures that you are processing different types of tasks in different shapes which is critical when debugging.
(originally posted by Dave B)
No comments:
Post a Comment