Problem with expression shape

Home Page Forums BizTalk 2004 – BizTalk 2010 Problem with expression shape

Viewing 1 reply thread
  • Author
    Posts
    • #22098

      I am using an Oracle adapter to insert an edi status record into my Oracle database.  Everything works fine as long as I have only a single insert in the message.  When I add a second insert, I receive an error.  The error is due to an xpath command I have which copies the messageID into one of the columns.

      My expression editor has the following two commands :

      Output_Insert_Message = Insert_Message;

      xpath(Output_Insert_Message,”//*[local-name()=’PARM_3′]”) = Insert_Message(BTS.MessageID);

       

      If I comment out the xpath command, everything works fine, but then the PARM_3 column in my Oracle database does not have the messageid.

       

      Here is the message that works:

      <ns0:Insert xmlns:ns0=”http://Microsoft.LobServices.OracleDB/2007/03/HM_WO/Table/WO_EDI_UPDATE_COMMAND“>
      <ns0:RECORDSET>
      <ns0:WO_EDI_UPDATE_COMMANDRECORDINSERT>
      <ns0:COMMAND_TYPE>RCVD_997</ns0:COMMAND_TYPE>
      <ns0:PARM_1>a</ns0:PARM_1>
      <ns0:PARM_3>x1</ns0:PARM_3>
      </ns0:WO_EDI_UPDATE_COMMANDRECORDINSERT>
      </ns0:RECORDSET></ns0:Insert>

       

      Here is the message that doesn’t work:

      <ns0:Insert xmlns:ns0=”http://Microsoft.LobServices.OracleDB/2007/03/HM_WO/Table/WO_EDI_UPDATE_COMMAND“>
      <ns0:RECORDSET>
      <ns0:WO_EDI_UPDATE_COMMANDRECORDINSERT>
      <ns0:COMMAND_TYPE>RCVD_997</ns0:COMMAND_TYPE>
      <ns0:PARM_1>a</ns0:PARM_1>
      <ns0:PARM_3>x1</ns0:PARM_3>
      </ns0:WO_EDI_UPDATE_COMMANDRECORDINSERT>
      <ns0:WO_EDI_UPDATE_COMMANDRECORDINSERT>
      <ns0:COMMAND_TYPE>RCVD_997</ns0:COMMAND_TYPE>
      <ns0:PARM_1>b</ns0:PARM_1>
      <ns0:PARM_3>x2</ns0:PARM_3>
      </ns0:WO_EDI_UPDATE_COMMANDRECORDINSERT>
      </ns0:RECORDSET></ns0:Insert>

       

      I assume that the reason the second message fails is that the xpath command finds more than one PARM_3 node, which the assignment command can’t handle.  My question is how to use the expression shape to update all PARM_3 nodes.

       

      Any help would be appreciated.

      Thanks.

    • #22099

      You could use something like this:

      xpath(Output_Insert_Message,”//*[1]/*[local-name()=’PARM_3′]“) = Insert_Message(BTS.MessageID);

      This will adjust the first WO_EDI_UPDATE_COMMANDRECORDINSERT’s PARM_3 node.

       

      xpath(Output_Insert_Message,”//*[2]/*[local-name()=’PARM_3′]“) = Insert_Message(BTS.MessageID);

      This will update the second, etc.

       

      I suppose you’d want to use a loop with a counter to update all fields. (I don’t know how you loop through/over your records at the moment.)

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.