|
Home > Archive > BizTalk Server Applications Integration > February 2005 > SetConfigData Not Working in AIC
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
SetConfigData Not Working in AIC
|
|
|
| Hi,
I have an AIC in BTS2002 that functions just fine with one exception. Any
design-time settings I make on the asp_post page for the advanced properties
of the channel are not being used by the AIC at runtime. My asp_post looks
like
<!--#INCLUDE FILE="pe_global_edit.asp" -->
<%
call GetInputText("Destination_Directory", 0, bufsize_medium)
%>
<!--#INCLUDE FILE="pe_post_footer.asp" -->
My .asp looks like
<!--#INCLUDE FILE="pe_edit_header.asp" -->
<%
call InputText("Destination_Directory")
%>
<!--#INCLUDE FILE="pe_edit_footer.asp" -->
They are both name correctly for the AIC's dll.
The relevant AIC code is here:
'Declarations
Private m_strDestinationDirectory As String = String.Empty
Private mDefaultDirectory As String = "D:\BTS\PriClaimOut"
Private Function IPipelineComponentAdmin_GetConfigData() As Object
Implements IPipelineComponentAdmin.GetConfigData
Dim configDict As IDictionary = New CDictionaryClass
configDict("Destination_Directory") = Me.m_strDestinationDirectory
Return configDict
End Function 'IPipelineComponentAdmin_GetCon
figData
Private Sub IPipelineComponentAdmin_SetConfigData(By
Val pDict As Object)
Implements IPipelineComponentAdmin.SetConfigData
Try
Dim configDict As IDictionary = CType(pDict, IDictionary)
If Not IsDBNull(configDict("Destination_Directory")) Then
If configDict("Destination_Directory").ToString.Length > 0 Then
Me.m_strDestinationDirectory = configDict("Destination_Directory").ToString
Else
Me.m_strDestinationDirectory = Me.mDefaultDirectory
End If
Else
Me.m_strDestinationDirectory = Me.mDefaultDirectory
End If
Catch ex As Exception
EventLog.WriteEntry("BTS_Log", "The following Error was encountered: " +
ex.ToString, EventLogEntryType.Error)
End Try
End Sub 'IPipelineComponentAdmin_SetConfigDa
ta
Private Function IPipelineComponent_Execute(ByVal dictTransport As Object,
ByVal pdispContext As Object, ByVal lFlags As Integer) As Integer Implements
IPipelineComponent.Execute
Try
'Overwrite configuration defaults with any values passed in
IPipelineComponentAdmin_SetConfigData(di
ctTransport)
If Not pdispContext Is Nothing Then
IPipelineComponentAdmin_SetConfigData(pd
ispContext)
End If
' Write the new file with reconstructed Trans Set Ctl Numbers
' in ST and SE segments
Return ProcessDocument(dictTransport("working_data").ToString)
Catch ex As Exception
EventLog.WriteEntry("BTS_Log", "The following Error was
encountered: " + ex.ToString, EventLogEntryType.Error)
Return 2 'Serious Error Occurred
End Try
End Function 'IPipelineComponent_Execute
--
-------------------------------------------------------------------------------------------
No matter what I set for destination directory in the advanced channel
properties dialog box, the output file ALWAYS gets dropped into the default
destination directory. The dialog box is persisting my custom setting, so
design time get and set features seem to be working just fine. It seems that
the runtime call to SetConfigData, which I understand is executed before the
Execute call, is NOT setting my class-level string variable for
m_strDestinationDirectory. Any help in how to fix this would be greatly
appreciated.
JT
| |
|
| Never mind. I figured out that since the second IDictionary Object being
sent in by Execute is the message itself, and the message does NOT have any
"Destination_Directory" info, this code in Execute was resetting my class
level m_strDestinationDirectory variable to the default:
'Overwrite configuration defaults with any values passed in
IPipelineComponentAdmin_SetConfigData(di
ctTransport)
I commented this out, and it now works just fine.
JT
"JT" wrote:
> Hi,
> I have an AIC in BTS2002 that functions just fine with one exception. Any
> design-time settings I make on the asp_post page for the advanced properties
> of the channel are not being used by the AIC at runtime. My asp_post looks
> like
>
> <!--#INCLUDE FILE="pe_global_edit.asp" -->
> <%
> call GetInputText("Destination_Directory", 0, bufsize_medium)
>
> %>
> <!--#INCLUDE FILE="pe_post_footer.asp" -->
>
> My .asp looks like
>
> <!--#INCLUDE FILE="pe_edit_header.asp" -->
> <%
> call InputText("Destination_Directory")
>
> %>
> <!--#INCLUDE FILE="pe_edit_footer.asp" -->
>
> They are both name correctly for the AIC's dll.
>
> The relevant AIC code is here:
>
> 'Declarations
> Private m_strDestinationDirectory As String = String.Empty
> Private mDefaultDirectory As String = "D:\BTS\PriClaimOut"
>
>
> Private Function IPipelineComponentAdmin_GetConfigData() As Object
> Implements IPipelineComponentAdmin.GetConfigData
>
> Dim configDict As IDictionary = New CDictionaryClass
>
> configDict("Destination_Directory") = Me.m_strDestinationDirectory
>
> Return configDict
>
> End Function 'IPipelineComponentAdmin_GetCon
figData
>
> Private Sub IPipelineComponentAdmin_SetConfigData(By
Val pDict As Object)
> Implements IPipelineComponentAdmin.SetConfigData
>
> Try
>
> Dim configDict As IDictionary = CType(pDict, IDictionary)
>
> If Not IsDBNull(configDict("Destination_Directory")) Then
> If configDict("Destination_Directory").ToString.Length > 0 Then
> Me.m_strDestinationDirectory = configDict("Destination_Directory").ToString
> Else
> Me.m_strDestinationDirectory = Me.mDefaultDirectory
> End If
> Else
> Me.m_strDestinationDirectory = Me.mDefaultDirectory
> End If
>
> Catch ex As Exception
> EventLog.WriteEntry("BTS_Log", "The following Error was encountered: " +
> ex.ToString, EventLogEntryType.Error)
> End Try
>
> End Sub 'IPipelineComponentAdmin_SetConfigDa
ta
>
> Private Function IPipelineComponent_Execute(ByVal dictTransport As Object,
> ByVal pdispContext As Object, ByVal lFlags As Integer) As Integer Implements
> IPipelineComponent.Execute
>
> Try
>
> 'Overwrite configuration defaults with any values passed in
> IPipelineComponentAdmin_SetConfigData(
dictTransport)
>
> If Not pdispContext Is Nothing Then
> IPipelineComponentAdmin_SetConfigData
(pdispContext)
> End If
>
> ' Write the new file with reconstructed Trans Set Ctl Numbers
> ' in ST and SE segments
> Return ProcessDocument(dictTransport("working_data").ToString)
>
> Catch ex As Exception
>
> EventLog.WriteEntry("BTS_Log", "The following Error was
> encountered: " + ex.ToString, EventLogEntryType.Error)
>
> Return 2 'Serious Error Occurred
>
> End Try
>
> End Function 'IPipelineComponent_Execute
> --
> -------------------------------------------------------------------------------------------
> No matter what I set for destination directory in the advanced channel
> properties dialog box, the output file ALWAYS gets dropped into the default
> destination directory. The dialog box is persisting my custom setting, so
> design time get and set features seem to be working just fine. It seems that
> the runtime call to SetConfigData, which I understand is executed before the
> Execute call, is NOT setting my class-level string variable for
> m_strDestinationDirectory. Any help in how to fix this would be greatly
> appreciated.
>
> JT
>
|
|
|
|
|