Skip to content

Commit 06962fa

Browse files
committed
routing
1 parent 2fc7d8f commit 06962fa

File tree

105 files changed

+3343
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+3343
-0
lines changed
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
namespace PipelineComponents.OperationPromotion
2+
{
3+
using System;
4+
using System.IO;
5+
using System.Text;
6+
using System.Drawing;
7+
using System.Resources;
8+
using System.Reflection;
9+
using System.Diagnostics;
10+
using System.Collections;
11+
using System.ComponentModel;
12+
using Microsoft.BizTalk.Message.Interop;
13+
using Microsoft.BizTalk.Component.Interop;
14+
using Microsoft.BizTalk.Component;
15+
using Microsoft.BizTalk.Messaging;
16+
using Microsoft.BizTalk.Streaming;
17+
18+
19+
[ComponentCategory(CategoryTypes.CATID_PipelineComponent)]
20+
[System.Runtime.InteropServices.Guid("80fb5b06-89b8-4518-ac6b-4ee4a1ef145a")]
21+
[ComponentCategory(CategoryTypes.CATID_Encoder)]
22+
public class CBRIdocOperationPromotionDecode : Microsoft.BizTalk.Component.Interop.IComponent, IBaseComponent, IPersistPropertyBag, IComponentUI
23+
{
24+
25+
private System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager("PipelineComponents.OperationPromotion.CBRIdocOperationPromotionDecode", Assembly.GetExecutingAssembly());
26+
27+
private string _MessageTypeStrIgnore;
28+
29+
public string MessageTypeStrIgnore
30+
{
31+
get
32+
{
33+
return _MessageTypeStrIgnore;
34+
}
35+
set
36+
{
37+
_MessageTypeStrIgnore = value;
38+
}
39+
}
40+
41+
#region IBaseComponent members
42+
/// <summary>
43+
/// Name of the component
44+
/// </summary>
45+
[Browsable(false)]
46+
public string Name
47+
{
48+
get
49+
{
50+
return resourceManager.GetString("COMPONENTNAME", System.Globalization.CultureInfo.InvariantCulture);
51+
}
52+
}
53+
54+
/// <summary>
55+
/// Version of the component
56+
/// </summary>
57+
[Browsable(false)]
58+
public string Version
59+
{
60+
get
61+
{
62+
return resourceManager.GetString("COMPONENTVERSION", System.Globalization.CultureInfo.InvariantCulture);
63+
}
64+
}
65+
66+
/// <summary>
67+
/// Description of the component
68+
/// </summary>
69+
[Browsable(false)]
70+
public string Description
71+
{
72+
get
73+
{
74+
return resourceManager.GetString("COMPONENTDESCRIPTION", System.Globalization.CultureInfo.InvariantCulture);
75+
}
76+
}
77+
#endregion
78+
79+
#region IPersistPropertyBag members
80+
/// <summary>
81+
/// Gets class ID of component for usage from unmanaged code.
82+
/// </summary>
83+
/// <param name="classid">
84+
/// Class ID of the component
85+
/// </param>
86+
public void GetClassID(out System.Guid classid)
87+
{
88+
classid = new System.Guid("80fb5b06-89b8-4518-ac6b-4ee4a1ef145a");
89+
}
90+
91+
/// <summary>
92+
/// not implemented
93+
/// </summary>
94+
public void InitNew()
95+
{
96+
}
97+
98+
/// <summary>
99+
/// Loads configuration properties for the component
100+
/// </summary>
101+
/// <param name="pb">Configuration property bag</param>
102+
/// <param name="errlog">Error status</param>
103+
public virtual void Load(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, int errlog)
104+
{
105+
object val = null;
106+
val = this.ReadPropertyBag(pb, "MessageTypeStrIgnore");
107+
if ((val != null))
108+
{
109+
this._MessageTypeStrIgnore = ((string)(val));
110+
}
111+
}
112+
113+
/// <summary>
114+
/// Saves the current component configuration into the property bag
115+
/// </summary>
116+
/// <param name="pb">Configuration property bag</param>
117+
/// <param name="fClearDirty">not used</param>
118+
/// <param name="fSaveAllProperties">not used</param>
119+
public virtual void Save(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, bool fClearDirty, bool fSaveAllProperties)
120+
{
121+
this.WritePropertyBag(pb, "MessageTypeStrIgnore", this.MessageTypeStrIgnore);
122+
}
123+
124+
#region utility functionality
125+
/// <summary>
126+
/// Reads property value from property bag
127+
/// </summary>
128+
/// <param name="pb">Property bag</param>
129+
/// <param name="propName">Name of property</param>
130+
/// <returns>Value of the property</returns>
131+
private object ReadPropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName)
132+
{
133+
object val = null;
134+
try
135+
{
136+
pb.Read(propName, out val, 0);
137+
}
138+
catch (System.ArgumentException )
139+
{
140+
return val;
141+
}
142+
catch (System.Exception e)
143+
{
144+
throw new System.ApplicationException(e.Message);
145+
}
146+
return val;
147+
}
148+
149+
/// <summary>
150+
/// Writes property values into a property bag.
151+
/// </summary>
152+
/// <param name="pb">Property bag.</param>
153+
/// <param name="propName">Name of property.</param>
154+
/// <param name="val">Value of property.</param>
155+
private void WritePropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName, object val)
156+
{
157+
try
158+
{
159+
pb.Write(propName, ref val);
160+
}
161+
catch (System.Exception e)
162+
{
163+
throw new System.ApplicationException(e.Message);
164+
}
165+
}
166+
#endregion
167+
#endregion
168+
169+
#region IComponentUI members
170+
/// <summary>
171+
/// Component icon to use in BizTalk Editor
172+
/// </summary>
173+
[Browsable(false)]
174+
public IntPtr Icon
175+
{
176+
get
177+
{
178+
return ((System.Drawing.Bitmap)(this.resourceManager.GetObject("COMPONENTICON", System.Globalization.CultureInfo.InvariantCulture))).GetHicon();
179+
}
180+
}
181+
182+
/// <summary>
183+
/// The Validate method is called by the BizTalk Editor during the build
184+
/// of a BizTalk project.
185+
/// </summary>
186+
/// <param name="obj">An Object containing the configuration properties.</param>
187+
/// <returns>The IEnumerator enables the caller to enumerate through a collection of strings containing error messages. These error messages appear as compiler error messages. To report successful property validation, the method should return an empty enumerator.</returns>
188+
public System.Collections.IEnumerator Validate(object obj)
189+
{
190+
// example implementation:
191+
// ArrayList errorList = new ArrayList();
192+
// errorList.Add("This is a compiler error");
193+
// return errorList.GetEnumerator();
194+
return null;
195+
}
196+
#endregion
197+
198+
#region IComponent members
199+
/// <summary>
200+
/// Implements IComponent.Execute method.
201+
/// </summary>
202+
/// <param name="pc">Pipeline context</param>
203+
/// <param name="inmsg">Input message</param>
204+
/// <returns>Original input message</returns>
205+
/// <remarks>
206+
/// IComponent.Execute method is used to initiate
207+
/// the processing of the message in this pipeline component.
208+
/// </remarks>
209+
public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
210+
{
211+
/*************************************************************************************************************************
212+
* This component will read the MessageType from the Message Context Properties. *
213+
* BTS.MessageType: Specifies the type of the message. The message type is defined as a concatenation of document *
214+
* schema namespace and document root node: http://<MyNamespace>#<MyRootNode>. *
215+
* and will promote the Operation property based on the content on the Root node "<MyRootNode>" specified on the *
216+
* message type "http://<MyNamespace>#<MyRootNode>" of the message. *
217+
* *
218+
* Ex: Message Type = "http://schemas.integration.com#GetClientInfo" *
219+
* Operation will be defined as "GetClientInfo" *
220+
************************************************************************************************************************/
221+
222+
// Note:
223+
// System properties are mostly used internally by BizTalk Messaging Engine and its components.
224+
// In general, changing the values set by the engine for those properties is not recommended, because it may affect
225+
// the execution logic of the engine. However, there are a large number of properties that you can change.
226+
227+
string msgType = Convert.ToString(inmsg.Context.Read("MessageType",
228+
"http://schemas.microsoft.com/BizTalk/2003/system-properties"));
229+
230+
string operation = msgType.Replace(_MessageTypeStrIgnore, "");
231+
operation = operation.Substring(0, operation.IndexOf('/'));
232+
233+
inmsg.Context.Promote("Operation", "http://schemas.microsoft.com/BizTalk/2003/system-properties",
234+
operation);
235+
236+
return inmsg;
237+
}
238+
#endregion
239+
}
240+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{7B0E5208-2F55-4143-A683-F61275CC1F14}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>PipelineComponents.OperationPromotion</RootNamespace>
11+
<AssemblyName>CBRIdocOperationPromotionDecode</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<SccProjectName>SAK</SccProjectName>
15+
<SccLocalPath>SAK</SccLocalPath>
16+
<SccAuxPath>SAK</SccAuxPath>
17+
<SccProvider>SAK</SccProvider>
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\Release\</OutputPath>
32+
<DefineConstants>TRACE</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
</PropertyGroup>
36+
<PropertyGroup>
37+
<SignAssembly>true</SignAssembly>
38+
</PropertyGroup>
39+
<PropertyGroup>
40+
<AssemblyOriginatorKeyFile>BizTalkComponents.snk</AssemblyOriginatorKeyFile>
41+
</PropertyGroup>
42+
<ItemGroup>
43+
<Reference Include="Microsoft.Biztalk.Messaging, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
44+
<Reference Include="Microsoft.BizTalk.Pipeline, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
45+
<Reference Include="Microsoft.BizTalk.Streaming, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
46+
<Reference Include="System" />
47+
<Reference Include="System.Core" />
48+
<Reference Include="System.Drawing" />
49+
<Reference Include="System.Xml.Linq" />
50+
<Reference Include="System.Data.DataSetExtensions" />
51+
<Reference Include="Microsoft.CSharp" />
52+
<Reference Include="System.Data" />
53+
<Reference Include="System.Xml" />
54+
</ItemGroup>
55+
<ItemGroup>
56+
<Compile Include="CBRIdocOperationPromotionDecode.cs" />
57+
<Compile Include="Properties\AssemblyInfo.cs" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<EmbeddedResource Include="CBRIdocOperationPromotionDecode.resx" />
61+
</ItemGroup>
62+
<ItemGroup>
63+
<None Include="BizTalkComponents.snk" />
64+
<None Include="CBR.bmp" />
65+
</ItemGroup>
66+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
67+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
68+
Other similar extension points exist, see Microsoft.Common.targets.
69+
<Target Name="BeforeBuild">
70+
</Target>
71+
<Target Name="AfterBuild">
72+
</Target>
73+
-->
74+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
""
2+
{
3+
"FILE_VERSION" = "9237"
4+
"ENLISTMENT_CHOICE" = "NEVER"
5+
"PROJECT_FILE_RELATIVE_PATH" = ""
6+
"NUMBER_OF_EXCLUDED_FILES" = "0"
7+
"ORIGINAL_PROJECT_FILE_PATH" = ""
8+
"NUMBER_OF_NESTED_PROJECTS" = "0"
9+
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10+
}

0 commit comments

Comments
 (0)