您可以从编排中动态加载和调用映射,如下所示:
// dynamicMapType is declared 'System.Type'
dynamicMapType = Helper.GetMapType(MessageTypeName);
// Call the transform given by the object type, pass in a message
transform(msgOut) = dynamicMapType(msgIn);
下面是一个获取贴图对象类型的示例。我把我的放在C#助手组件里。
public static System.Type GetMapType(string MessageType)
{
System.Type typ = null;
switch (MessageType.ToUpper())
{
case "ONE":
typ = System.Type.GetType("AssemblyQualifiedName_from_gacutil");
break;
default:
throw new SystemException("Could not determine map transform type '" + MessageType + "'");
}
if (typ == null)
throw new SystemException("Could not load map transform type '" + MessageType + "'");
return typ;
}