web stats
Add element to CCDA - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2018, 01:26 PM
gojoshi gojoshi is offline
OBX.1 Kenobi
 
Join Date: Jul 2013
Posts: 42
gojoshi is on a distinguished road
Default Add element to CCDA

I need to search for an element in a CCDA message and add it if it's missing. So for example if the elements should like like as shown below:
First elementSecond ElementThird Element

I am occasionally not reeving the second element.so IF and only IF the second element is missing then I would need to append it.

If anyone can help, it would be greatly appreciated.
Reply With Quote
  #2  
Old 04-06-2018, 08:39 AM
martinan martinan is offline
Mirth Newb
 
Join Date: Sep 2015
Posts: 16
martinan is on a distinguished road
Default

Without more details it's tough to give a detailed way to do exactly what you're asking for, but here's a basic example of what it sounds like you're looking for:

Code:
if(msg.testnodeB.length() == 0){
	msg.insertChildAfter(msg.testnodeA[0], <testnodeB/>);
}
inbound message
Code:
<message>
    <testnodeA/>
    <testnodeC/>
</message>
outbound message
Code:
<message>
    <testnodeA/>
    <testnodeB/>
    <testnodeC/>
</message>
Reply With Quote
Reply

Tags
ccda, xml

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 08:00 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation