In my orchestration I have various steps that maps a flat file to 2 intermediate messages and eventually writes to SQL. First I made it without exception handling and it worked with a valid input file.
msg0 msg1 msg2
┌──────┐ ┌─────┐ ┌───────┐ ┌───────┐ ┌─────┐
│ PIPE │-►│ RCV │-►│ MAP_1 │-►│ MAP_2 │-►│ SQL │
└──────┘ └─────┘ └───────┘ └───────┘ └─────┘
Now I'm trying to get the exceptions for every scope where I use a map. at the beginning of the orchestration, after the first Receive Shape, I put a Construct Message Shape that initializes all messages in the orchestration. I create the catch blocks (each with Construct shape for my fault_msg and its send shape), the FILE port, and build.
msg0 msg1 msg2
┌──────┐ ┌─────┐ ┌──────┬──┐ ┌───────┬──┐ ┌───────┬──┐ ┌─────┬──┐
│ PIPE │-►│ RCV │-►│ INIT │ex│-►│ MAP_1 │ex│-►│ MAP_2 │ex│-►│ SQL │ex│
└──────┘ └─────┘ └──────┴──┘ └───────┴──┘ └───────┴──┘ └─────┴──┘
VS KEEPS ASKING for msg initialization even in the map blocks for the messages that should enter ALREADY filled (or populated, or whatever the term is). Why is that?
EDIT: I figured out BT wants every msg initialized even when not used during exception handling. So I need to construct my custom fault message that will return the empty messages along with my custom fault message. In order to initialize them of course i need to declare at the beginning of the expression code this way:
unusedMsg.Part = new System.Xml.XmlDocument();
Thing is now: the problem still comes out for the last mapping (sql):
┌──────────────────────┐
│ scope │
│ ┌────────────────┐ │
┌──────┐ │ │ MAP │ │ ┌────────┐
│ msg2 │ -►│ │ msg2 > sqlReq │ │ -► │ sqlReq │
└──────┘ │ └────────────────┘ │ └────────┘
├──────────────────────┤
│ ex │
│ ┌────────────────┐ │
│ │ construct │ │ ┌────────┐
│ │ msg2 > msgERR │ │ -► │ msgERR │
│ └────────────────┘ │ └────────┘
└──────────────────────┘
where it keeps asking this:
msg2.Part': message part has not been initialized in construct statement
and yet I know for sure that msg2 IS INITIALIZED because I had no exception producing it and I'm entering the new scope. How's that possible?