Eric’s BizTalk 2004/2006 Blog

My BizTalk Experiences using Flat Files, InfoPath, BAM, BRE, BAS, HL7, HIPAA, WSS.

April 25, 2006

Multiple Input to BizTalk maps

Filed under: BizTalk — eric @ 11:43 pm

This also can work for multiple outputs to BizTalk Map also.

A recent post was asked how to take multipe messages and merge them into an output message structure. This actually puzzed me while I was learning the way BizTalk worked. Here is a simple example of how it works, and how to implement it…

  1. The first thing this orchestration does is start off by consuming a trigger message.
  2. It then constructs the calls to the two stored procedures
  3. Then it calls the stored procedures and gets the responses from the stored procedures.
  4. It then takes the two responses and invokes the map. Here is the picture of the input arguments to the map:
  5. This is what the map looks like after you create the map with the multiple inputs:
  6. It then creates the file an sends the resulting file out.
  7. Here is the complete view of the orchestration:

Setup Instructions:

  1. Extract this file
  2. In the Properties of the project point to a strong named key file and set the BizTalkMgmtDB to your server
  3. Run the included sql script against the Northwind database to create the stored procedures
  4. Deploy the project
  5. create 4 ports
    • One input using Default XML pipeline and pointing to ..\MultipleInput\Input directory
    • Two Static Solicit/Response ports pointing to the Nortwind database and setting the Document Target Namespace to be http://storedprocx/ (X being the number of the stored proc), setting default xml as both the Send and Receive pipelines
    • One send port, setting the default xml pipline and pointing to the ..\MultipleInput\Output directory
  6. Bind the logical ports to the physical ports created in step 5
  7. Start the orchestration, drop the trigger in the Input directory, and you are good to go 

April 20, 2006

Biztalk Macros

Filed under: BizTalk — eric @ 10:15 pm

I am tired of constantly having to look up what the macros are for BizTalk

Macro
Definition
%datetime%
Coordinated Universal Time (UTC) date time in the format YYYY-MM-DDThhmmss (for example, 1997-07-12T103508).
%datetime_bts2000%
UTC date time in the format YYYYMMDDhhmmsss, where sss means seconds and milliseconds (for example, 199707121035234 means 1997/07/12, 10:35:23 and 400 milliseconds).
%datetime.tz%
Local date time plus time zone from GMT in the format YYYY-MM-DDThhmmssTZD, (for example, 1997-07-12T103508+800).
%DestinationParty%
Name of the destination party. The value comes from the message context property BTS.DestinationParty.
%MessageID%
Globally unique identifier (GUID) of the message in BizTalk Server. The value comes directly from the message context property BTS.MessageID.
%SourceFileName%
Name of the file from where the File adapter read the message. The file name includes the extension and excludes the file path, for example, Sample.xml. When substituting this property, the File adapter extracts the file name from the absolute file path stored in the FILE.ReceivedFileName context property. If the context property does not have a value, for example, if a message was received on an adapter other than the File adapter, the macro will not be substituted and will remain in the file name as is (for example, C:\Drop\%SourceFileName%).
%SourceParty%
Name of the source party from which the File adapter received the message.
%SourcePartyQualifier%
Qualifier of the source party from which the File adapter received the message.
%time%
UTC time in the format hhmmss.
%time.tz%
Local time plus time zone from GMT in the format hhmmssTZD (for example, 124525+530).

April 18, 2006

Case of the Missing acknowledgment

Filed under: BizTalk, HL7 — eric @ 10:36 pm

It seems that every client that I assist in implementing HL7, we get to testing the process and we send in an ADT, ORM, ORU, or some other message and we wait for the automated acknowledment, but it never comes.

I then remember that unless I have MLLP version 1.0.308.0, and 1.0.309.0 (current) of Microsoft.solutions.btahl7.mllp.dll I better camp out for a while, while I know it states that it can take up to 10 seconds to get the ack, I have gone to lunch and come back with no response. I even heard that there is a 24 hr delay. So make sure that you have the following patches from Microsoft for the HL7 adapter.

  • KB893369: HL7 Interrogative transactions may take 10 or more seconds to complete when MLLP synchronizes communications end-to-end
  • KB893404: The BizTalk Accelerator for HL7 sends an acknowledgement message to the source system after a long delay

Don’t forget to follow the post installation instruction on getting the send adapter to be a solicit/response as documented here.  

April 12, 2006

BAM and Reporting

Filed under: BAM, BizTalk — eric @ 10:10 pm

A recent post was written about attempting to query the DTADB database to capture data and send it to a particular customer. I suggested that this is a purpose in Business Activity Monitoring. I have created a sample application that demonstrates some of the powers of BAM.

In this example orders are processed by Biztalk, and key data elements are extracted and sent to the BAMPrimaryImport database.
BAM1.JPG

Another orchestration takes the information in the database and creates a report and sends it out to the customer.

BAM2.JPG

Setup Instructions:

  1. Download this file.
  2. Run the following command from a dos prompt to create the necessary BAM objects: \Tracking\BM.exe deploy ..\BAMReporting\ActivityInfo.xml
  3. Run the extractBAM.sql against the BAMPrimaryImportDb
  4. Deploy the solution
  5. Modify the binding.xml file to represent your enviornment
  6. Bind the ports using the Deployment wizard.
  7. Enlist the orchestrations
  8. Drop Order 1.xml, Order 2.xml, and Order 3.xml into the Input folder
  9. Wait and then drop the Confirmation 1.xml, Confirmation 2.xml, and Confirmation 3.xml into the Input folder
  10. Drop the Trigger.xml file into the input file and in the output folder there should be an email xml file that shows various BAM data.

This actually goes against my better concience on at least 2 fronts:

  • BizTalk has the ability to do a lot of things, but sometimes it shouldn’t. I know of some people think that it is better than sliced bread, but a more elegant solution would be to use SQLReporting services that would go against the BAMPrimaryImportDB
  • It uses a trigger file to kick off the report, there could be a better way, with a proper stored proc to do some marking of the data so no duplicate reports get run

April 7, 2006

MLLP Port Definition and Invoking Test Tool

Filed under: BizTalk, HL7 — eric @ 1:02 pm

In the BizTalk HL7 accelerator, you set up the port definition and assign the delimiters in HEX, but then if you are going to test it using the MLLP Send test tool, you have to use the Decimal equivalent. I am surprised that they did not include the following table as part of the documentation.

Also, one of the things not clearly explained is the promoted property DoorbellFinalMessage(BTAHL7Schemas.MSH1) = 124; this is the decimal version of |

 
DOS
Port
Char/Description
0
00
null
1
01
start of heading
2
02
start of text
3
03
end of text
4
04
end of transmission
5
05
enquiry
6
06
acknowledge
7
07
bell
8
08
backspace
9
09
horizontal tab
10
0A
new line
11
0B
vertical tab
12
0C
new page
13
0D
carriage return
14
0E
shift out
15
0F
shift in
16
10
data link escape
17
11
device control 1
18
12
device control 2
19
13
device control 3
20
14
device control 4
21
15
negative acknowledge
22
16
synchronous idle
23
17
end of trans. block
24
18
cancel
25
19
end of medium
26
1A
substitute
27
1B
escape
28
1C
file separator
29
1D
group separator
30
1E
record separator
31
1F
unit separator
32
20
space
33
21
!
34
22

35
23
#
36
24
$
37
25
%
38
26
&
39
27

40
28
(
41
29
)
42
2A
*
43
2B
+
44
2C
,
45
2D
-
46
2E
.
47
2F
/
48
30
0
49
31
1
50
32
2
51
33
3
52
34
4
53
35
5
54
36
6
55
37
7
56
38
8
57
39
9
58
3A
:
59
3B
;
60
3C
<
61
3D
=
62
3E
>
63
3F
?
64
40
@
65
41
A
66
42
B
67
43
C
68
44
D
69
45
E
70
46
F
71
47
G
72
48
H
73
49
I
74
4A
J
75
4B
K
76
4C
L
77
4D
M
78
4E
N
79
4F
O
80
50
P
81
51
Q
82
52
R
83
53
S
84
54
T
85
55
U
86
56
V
87
57
W
88
58
X
89
59
Y
90
5A
Z
91
5B
[
92
5C
\
93
5D
]
94
5E
^
95
5F
_
96
60
`
97
61
a
98
62
b
99
63
c
100
64
d
101
65
e
102
66
f
103
67
g
104
68
h
105
69
i
106
6A
j
107
6B
k
108
6C
l
109
6D
m
110
6E
n
111
6F
o
112
70
p
113
71
q
114
72
r
115
73
s
116
74
t
117
75
u
118
76
v
119
77
w
120
78
x
121
79
y
122
7A
z
123
7B
{
124
7C
|
125
7D
}
126
7E
~
127
7F
DEL

April 6, 2006

Understanding how BizTalk handles HL7 Acknowledgments

Filed under: BizTalk, HL7 — eric @ 9:14 pm

Inside of the Hl7 Configuration Explorer, the tab for Acknowledgments, most of the fields in there were foreign when I first started dealing with HL7, so below is a list of the values and what they mean.

Acknowedgment Type:

None
Select this if you do not want to configure any acknowledgements. This does not mean that it will turn off acknowledgments if the message comes in with MSH 15 with anything other than NE. In that case the pipeline will create an acknowledgment regardless.
Original
Select this option to override
MSH1 – Field Separator
MSH2 – Encoding Characters
MSH3 – Sender Identifiers
MSH5 – Receiver Identifiers
MSH8 – Security options only
Enhanced
Select this option to override all available acknowledgement options.   

AL
Select this option if you always want to send acknowledgements.
NE
Select this option if you never want to send acknowledgements.
SU
Select this option if you want to send acknowledgements after a successful transmission of a message.
ER
Select this option if you want to send acknowledgements only in the event of an error.

MSH1 – Field Separator
MSH2 – Encoding Characters
MSH3 – Sender Identifiers
MSH5 – Receiver Identifiers
MSH8 – Security options only

Deferred
Select this option to override
MSH1 – Field Separator
MSH2 – Encoding Characters
MSH3 – Sender Identifiers
MSH5 – Receiver Identifiers
MSH8 – Security options only
Static
Select this option to configure the On success and On failure acknowledgement options.

All of these entries that can be made in the Original, Enhanced, and Defferred Mode, if you do not place data in MSH3 and MSH5, it will automatically reverse them on the acknowledgment. 

There was two scenerios that I will discuss that I seem to find that are common.

  1. The interface is always requiring one acknowledgment, but that one acknowledgment needs to be either a NAck because of structural problems, or if there are no structural issues, then the Ack (or NAck) needs to then comes from BizTalk.
    • It was set up in the Acknowedgment tab to be running in Enhanced Mode
    • I set the MSH15 to be ER, so that if the pipeline came across parsing errors, and automatic NAck will be produced and sent back to the sending interface
    • In the Orchestration that consumed the message, the recieve shape had a filter of BTAHL7.ParseError==false so that it would not consume a unparsed message and interpret it incorrectly
    • At the conclusion of the Orchestration, I had three different Construct Shapes that created either an Ack (MSA1 AA), Warning Ack (MSA1 AR), and NAck (MSA1 AE) and sent it back to the sending interface.
  2. Another client had a system that required an acknowledgment with MSA1 as AA; any other code it would simply resend the message before sending the next message.
    • There was a flat file pipeline that consumed the original message, and sent it to an orchestration that created a multipart message that sent back a Positive Ack, then dropped the message for the ‘real’ parsing by the 2X pipeline dissassembler.
    • This second pass would then be consumed by the real work orchestration that would make a decision based on the BTAHL7.ParseError flag to send the original message and the subsequent NAck to a sharepoint site.
    • If there were no parse errors, then it would successfully process the messages. 

April 4, 2006

Request/Response for MLLP adapter Post Install Instructions

Filed under: BizTalk, HL7 — eric @ 11:32 am

I had forgot about this little document while at a client site, so here it is for reference:

If you have already developed BizTalk Server artifacts that use the native MLLP adapter you must delete and recreate them with the updated MLLP adapter.
To update the existing MLLP adapter
1.               Using Windows Explorer create the C:\MLLPTemp\ folder.
2.               Click Start, point to Programs, point to Microsoft Visual Studio .NET 2003, and then click Microsoft Visual Studio .NET 2003.
3.               In Microsoft Visual Studio .NET 2003, click View on the toolbar, and then click BizTalk Explorer.
4.               In BizTalk Explorer, expand erver name>.BizTalkMgmtDb.dbo, expand TwoWayAckReceivePort, expand Receive Locations, and then right-click TwoWayAckReceiveLocation, and the click Edit.
5.               In the Receive Location Properties - Configuration - General dialog box, in the Transport Type drop-down box select File.
6.               In the Receive Location Properties - Configuration - General dialog box, in the Address (URI) box click the ellipsis () button.
7.               In the File Transport Properties dialog box, in the Receive folder box, type C:\MLLPTemp\.
8.               Click OK.
9.               In the Receive Location Properties - Configuration - General dialog box, in the Receive Handler drop-down box select BizTalkServerApplication.
10.           Click OK.
Note  If you have any BizTalk Server artifacts configured using MLLP adapter, you must repeat steps 3-9 for each artifact before proceeding. Be sure to save the configuration information so that you can update the artifacts using the updated MLLP adapter. You must also save Receive and Send Handlers configuration information if you have customized the MLLP adapter.
11.           Click Start, point to Programs, point to Microsoft BizTalk 2004, and then click BizTalk Server Administration.
12.           In the BizTalk Administration Console, expand Microsoft BizTalk Server 2004 (Local), expand Adapters, right-click the MLLP from the list, and then click Delete.
13.           In the BizTalk Server Administration dialog box click Yes.
14.           In the BizTalk Administration Console, right-click Adapters, point to New, and then click Adapter.
15.           In the Add Adapter dialog box, in the Name box type MLLP, in the Adapter drop-down select MLLP, and then click OK.
16.           Close the BizTalk Administration Console.
17.           In Microsoft Visual Studio .NET 2003, in the BizTalk Explorer, click Refresh on the toolbar.
18.           In the BizTalk Explorer, right-click TwoWayAckReceiveLocation, and the click Edit.
19.           In the Receive Location Properties - Configuration - General dialog box, in the Transport Type drop-down box select MLLP.
20.           In the Receive Location Properties - Configuration - General dialog box, in the Address (URI) box click the ellipsis () button.
21.           In the MLLP Transport Properties dialog box, do the following:

Use this
To do this
Connection Name
Type MLLP.
Host
Type 127.0.0.1.
Port
Type 65535.

22.           Click OK.
23.           In the Receive Location Properties - Configuration - General dialog box, click OK.