#1
|
|||
|
|||
![]()
Hi All,
I'm totally new to Mirth and need some advice with setting up a new Channel. I have a SOAP Template that could include more than the 3 entries for OUT_DERIVED_ATTRIBUTE_id_*. Is there a recommended methodology to capture the possibility of more than the 3 OUT_DERIVED_ATTRIBUTE_id's below? <ns1:WorkDocuments> <ns1:CONTROL id="CONTROL_id_1"> <ns1:ERROR_FOUND>false</ns1:ERROR_FOUND> <ns1:executeRules>true</ns1:executeRules> <ns1:TRUSTID_ID>TEST</ns1:TRUSTID_ID> <ns1:EXPERIENCE_NUMBER>00001234</ns1:EXPERIENCE_NUMBER> <ns1:VISIT_ID>123456789</ns1:VISIT_ID> <ns1:OUT_DERIVED_ATTRIBUTE href="#OUT_DERIVED_ATTRIBUTE_id_1"/> <ns1:OUT_DERIVED_ATTRIBUTE href="#OUT_DERIVED_ATTRIBUTE_id_2"/> <ns1:OUT_DERIVED_ATTRIBUTE href="#OUT_DERIVED_ATTRIBUTE_id_3"/> </ns1:CONTROL> <ns1:OUT_DERIVED_ATTRIBUTE id="OUT_DERIVED_ATTRIBUTE_id_1"> <ns1:ATTRIBUTE_NAME>TEST_COLUMN_1</ns1:ATTRIBUTE_NAME> <ns1:ATTRIBUTE_STATUS>NEW</ns1:ATTRIBUTE_STATUS> <ns1:ATTRIBUTE_TABLE>TESTING_TABLE</ns1:ATTRIBUTE_TABLE> <ns1:ATTRIBUTE_VALUE>Y</ns1:ATTRIBUTE_VALUE> </ns1:OUT_DERIVED_ATTRIBUTE> <ns1:OUT_DERIVED_ATTRIBUTE id="OUT_DERIVED_ATTRIBUTE_id_2"> <ns1:ATTRIBUTE_NAME>TEST_COLUMN_2</ns1:ATTRIBUTE_NAME> <ns1:ATTRIBUTE_STATUS>NEW</ns1:ATTRIBUTE_STATUS> <ns1:ATTRIBUTE_TABLE>TESTING_TABLE</ns1:ATTRIBUTE_TABLE> <ns1:ATTRIBUTE_VALUE>N</ns1:ATTRIBUTE_VALUE> </ns1:OUT_DERIVED_ATTRIBUTE> <ns1:OUT_DERIVED_ATTRIBUTE id="OUT_DERIVED_ATTRIBUTE_id_3"> <ns1:ATTRIBUTE_NAME>TEST_COLUMN_3</ns1:ATTRIBUTE_NAME> <ns1:ATTRIBUTE_STATUS>IDENTICAL</ns1:ATTRIBUTE_STATUS> <ns1:ATTRIBUTE_TABLE>TESTING_TABLE</ns1:ATTRIBUTE_TABLE> <ns1:ATTRIBUTE_VALUE>2</ns1:ATTRIBUTE_VALUE> </ns1:OUT_DERIVED_ATTRIBUTE> </ns1:WorkDocuments> At present I've created the Source Transformer with Variable: AttributeNameNS1 Mapping: msg['SOAP:Body']['ns1:CorticonResponse']['ns1:WorkDocuments']['ns1:OUT_DERIVED_ATTRIBUTE'][0]['ns1:ATTRIBUTE_NAME'].toString() Variable: AttributeTableNS1 msg['SOAP:Body']['ns1:CorticonResponse']['ns1:WorkDocuments']['ns1:OUT_DERIVED_ATTRIBUTE'][0]['ns1:ATTRIBUTE_TABLE'].toString() Variable: AttributeStatusNS1 msg['SOAP:Body']['ns1:CorticonResponse']['ns1:WorkDocuments']['ns1:OUT_DERIVED_ATTRIBUTE'][0]['ns1:ATTRIBUTE_STATUS'].toString() Variable: AttributeValueNS1 msg['SOAP:Body']['ns1:CorticonResponse']['ns1:WorkDocuments']['ns1:OUT_DERIVED_ATTRIBUTE'][0]['ns1:ATTRIBUTE_VALUE'].toString() and repeating this for each additional 2 more in the SOAP example then creating upto 10 more if they exist further.. Last edited by jupiterUK; 04-27-2012 at 06:43 AM. |
#2
|
||||
|
||||
![]()
Assuming that there aren't any namespace issues in your channel (make sure that you aren't stripping namespaces in the protocol settings, and you may want to set the default namespace explicitly), you could do this:
Code:
for each (oda in msg.Body.ns1::CorticonResponse.ns1::WorkDocuments.ns1::OUT_DERIVED_ATTRIBUTE) { logger.info('Name: '+oda.ns1::ATTRIBUTE_NAME.toString()+ ' Table: '+oda.ns1::ATTRIBUTE_TABLE.toString()+ ' Status: '+oda.ns1::ATTRIBUTE_STATUS.toString()+ ' Value: '+oda.ns1::ATTRIBUTE_VALUE.toString()); } |
#3
|
|||
|
|||
![]()
Hi there,
Thanks for that I will give it a try. Thanks AJ |
![]() |
Thread Tools | |
Display Modes | |
|
|