Conversie van de TransSmart solution van BizTalk 2013 naar 2016.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

TM.Shared.OrderStatus_to_TM.TransSmart.Status.xsl 3.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  2. xmlns:ScriptNS0="http://schemas.microsoft.com/BizTalk/2003/ScriptNS0"
  3. xmlns:ScriptNS1="http://schemas.microsoft.com/BizTalk/2003/ScriptNS1"
  4. xmlns:DateTime="TM.Shared.Components.DateTime"
  5. xmlns:SSO="TM.Shared.Components.SSO"
  6. xmlns:String="TM.Shared.Components.String"
  7. xmlns:s0="http://TM.KLG.com/KLG/OrderStatus/v19A"
  8. xmlns:ns0="http://TM.nShift.messages"
  9. exclude-result-prefixes="s0 ns0 ScriptNS0 ScriptNS1 DateTime SSO String">
  10. <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" indent="yes" />
  11. <!-- region global variable initialization -->
  12. <xsl:variable name="connectionString" select="SSO:GetValue('TM.TransSmart', 'ESBLookupConnectionString')"/>
  13. <xsl:variable name ="sender">
  14. <xsl:choose>
  15. <xsl:when test="/s0:StatusReport/Sender='KLGEUEERSE01'">KLE</xsl:when>
  16. <xsl:when test="/s0:StatusReport/Sender='KLGEUVENLO01'">KLG</xsl:when>
  17. <xsl:otherwise>KLG</xsl:otherwise>
  18. </xsl:choose>
  19. </xsl:variable>
  20. <!-- end region -->
  21. <!-- region templates -->
  22. <xsl:template match="/">
  23. <xsl:apply-templates select="/s0:StatusReport" />
  24. </xsl:template>
  25. <xsl:template match="/s0:StatusReport">
  26. <xsl:variable name="currentDateTime" select="DateTime:GetCurrentDateTime()" />
  27. <xsl:variable name="currentDate" select="DateTime:GetCurrentDate()" />
  28. <ns0:root>
  29. <ns0:status>
  30. <xsl:attribute name="carrier">
  31. <xsl:value-of select="$sender" />
  32. </xsl:attribute>
  33. <xsl:for-each select="Status">
  34. <ns0:shipment>
  35. <ns0:lineNo>
  36. <xsl:number/>
  37. </ns0:lineNo>
  38. <ns0:statusTimeStamp>
  39. <xsl:value-of select="DateTime:FormatDateTime(/s0:StatusReport/TimeStamp, 'yyyy-MM-ddTHH:mm:ss', 'yyyyMMddHHmmss', 'statusTimeStamp')"/>
  40. </ns0:statusTimeStamp>
  41. <ns0:reference>
  42. <xsl:value-of select="ShipmentReference"/>
  43. </ns0:reference>
  44. <xsl:if test="StatusCode='DELIVERED'">
  45. <ns0:deliveryDate>
  46. <xsl:value-of select="DateTime:FormatDateTime(StatusTimeStamp, 'yyyy-MM-ddTHH:mm:ss', 'yyyyMMdd', 'statusTimeStamp')"/>
  47. </ns0:deliveryDate>
  48. <ns0:deliveryTime>
  49. <xsl:value-of select="DateTime:FormatDateTime(StatusTimeStamp, 'yyyy-MM-ddTHH:mm:ss', 'HHmmss', 'statusTimeStamp')"/>
  50. </ns0:deliveryTime>
  51. </xsl:if>
  52. <ns0:shipmentStatus>
  53. <xsl:choose>
  54. <xsl:when test="StatusCode='DELIVERED'">
  55. <xsl:text>DONE</xsl:text>
  56. </xsl:when>
  57. <xsl:when test="StatusCode='DELIVERY' and ReasonCode='TRANSIT'">
  58. <xsl:text>TRNS</xsl:text>
  59. </xsl:when>
  60. <xsl:otherwise>TRNS</xsl:otherwise>
  61. </xsl:choose>
  62. </ns0:shipmentStatus>
  63. <ns0:carrierStatusCode>
  64. <xsl:value-of select="StatusCode"/>
  65. <xsl:text> </xsl:text>
  66. <xsl:value-of select="ReasonCode"/>
  67. </ns0:carrierStatusCode>
  68. </ns0:shipment>
  69. </xsl:for-each>
  70. </ns0:status>
  71. </ns0:root>
  72. </xsl:template>
  73. <!-- end region -->
  74. <xsl:variable name="dbClose" select="ScriptNS0:DBLookupShutdown()"/>
  75. </xsl:stylesheet>