5 Replies Latest reply: Apr 4, 2013 6:28 PM by vladodias RSS

    How to put input variable (elementName in xpath) name in runtime for Assign

      Hi All,

      I want to know how to refer an XSD schema based variable's element and assign it to some other variable at runtime. I mean how can i put the 'To' element's name in assign-activity at run-time?

      Suppose i am having a variable "varInput_PastDuedata" which as below expansion:-

      <> ns6:Root-Element-Email
      <> ns6:emailRecords
      <> ns6:CCID
      <> ns6:ACCTNO
      <> ns6:CUTOFFDATE
      <> ns6:AMOUNTDUE
      <> ns6:MOBNO
      <> ns6:TO
      <> ns6:FROM

      Now suppose we have assigned text "ACCTNO" to a "String" type variable "varTempString_AcctNo"

      now after above step lets have an assign activity. Now, if we want to assign "varInput_PastDuedata->body->ns6:Root-Element-Email->ns6:emailRecords->ns6:ACCTNO" variable's data to a "String" type variable "varTempResult"
      then we simply assign bpws:getVariableData('varInput_PastDuedata','body','/ns6:Root-Element-Email/ns6:emailRecords/ns6:ACCTNO')
      expression to "varTempResult" variable. But what if i define the element name in run-time which is to be assigned to "varTempResult" then how to do it?

      I tried below steps but failed:-
      1) I first assigned "ACCTNO" text to a "String" type vaiable "varTempString_AcctNo"
      2) Then i tried doing below assignment:-
      <from expression="bpws:getVariableData('varInput_PastDuedata','body','/ns6:Root-Element-Email/ns6:emailRecords/ns6:$varTempString_AcctNo')"/>
      <to variable="varTempResult"/>
      but it failed at run-time
      3) I also tried below assigment:-
      <from expression="bpws:getVariableData('varInput_PastDuedata','body','/ns6:Root-Element-Email/ns6:emailRecords','/ns6:$varTempString_AcctNo')"/>
      <to variable="varTempResult"/>
      but this one also got failed
      4) I tried below assigment also:-
      <from expression="bpws:getVariableData('varInput_PastDuedata','body','/ns6:Root-Element-Email/ns6:emailRecords',bpws:getVariableData(varTempString_AcctNo)"/>
      <to variable="varTempResult"/>
      but this one also got failed

      Please help me in finding the solution for how can i achieve this functionality and decide at run-time about which element is to be used in assignment. Write me for further input if you want in this regard..

      Mahipal Singh