1. Problem
You want to add decryption as a stage in your processing of inbound EDI documents. The standard EdiReceive pipeline does not support this, and you need to create a custom pipeline.
2. Solution
This solution does not
provide the code for the decryption custom pipeline component, but it
does show how to reference a custom pipeline component and the EDI
pipeline components to create a custom pipeline.
In your Visual Studio project, add a new pipeline by right-clicking the project, and selecting Add => New Item. Select the Receive Pipeline template, and give it an appropriate name.
The
Decode stage is where you will want to do the decryption. An inbound
file must be decrypted before it can be run through the EDI components.
Drag the decryption custom pipeline component from the Visual Studio
toolbox to the Decode stage of the pipeline. Figure 1 shows the Decode stage with both a decryption and an archiving component.
Next, drag and drop the EDI disassembler component onto the Disassemble stage of the pipeline, as shown in Figure 2.
Set
the EDI disassembler properties to the default values that you want.
Note that these can all be overridden once the pipeline has been
deployed, so these are just being set for the defaults. This can be done
by right-clicking the EDI disassembler and selecting Properties. The
properties are shown in Figure 3.
3. How It Works
Creating custom pipelines is
fairly easy; creating custom pipeline components is not. In this case,
you want to create both a custom pipeline component (for decryption) and
a custom pipeline (to house this custom component and to execute the
standard EDI disassembly that occurs). Once the pipeline is fully
configured and built, it can be deployed just like any other BizTalk
artifact. The easiest thing to do is to right-click the BizTalk
application where you want to deploy it and select Add => BizTalk Assemblies (as shown in Figure 4).