Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Process Manager (Stardust) » JSON string to structured data type conversion.(JSON string to structured data type conversion.)
JSON string to structured data type conversion. [message #1708981] Wed, 23 September 2015 06:38 Go to next message
Ts Patil is currently offline Ts PatilFriend
Messages: 32
Registered: September 2015
Member
HI,

I am looking for an example source or help to convert JSON string to structured data type.

I am using IPP browser modeller and making a call to web service which returns me a JSON string

e.g.
[{"Id":5,"Name":"abc","eMail":"abcd@abc.com","isActive":1},
{"Id":6,"Name":"def","eMail":"pqr@abc.com","isActive":1}]

And I want to convert it into structured data type named

Student - which having all four fields.
Id, Name, eMail, isActive.

Which application type will help to covert the JSON string to Structure data. Or any example source or any pointer.

Thanks in advance.
Re: JSON string to structured data type conversion. [message #1709110 is a reply to message #1708981] Thu, 24 September 2015 07:06 Go to previous messageGo to next message
Vikram Kodak is currently offline Vikram KodakFriend
Messages: 72
Registered: October 2011
Member
Hi,

Do you see this defined SDT changing (business object), or will remain the same? If static there could be a straight forward conversion to SDT, or else if the JSON/format is changing it could be you will have to use the Script invocation app and write a custom script.
Re: JSON string to structured data type conversion. [message #1709127 is a reply to message #1709110] Thu, 24 September 2015 09:43 Go to previous messageGo to next message
Ashish Khole is currently offline Ashish KholeFriend
Messages: 28
Registered: April 2015
Junior Member
Hi,

Attached is the testModel which converts the JSONdata to SDT.

The model takes the input as a PrimitiveData(String) as follows:
{"Students":[{"Id":5,"Name":"abc","eMail":"abcd@abc.com","isActive":1},
{"Id":6,"Name":"def","eMail":"pqr@abc.com","isActive":1}]}

which Stores the result in the SDT Data "Students". Model uses GenericCamel Application for the Conversion.

Hope this helps!!

-Cheers
Ashish

[Updated on: Thu, 24 September 2015 09:45]

Report message to a moderator

Re: JSON string to structured data type conversion. [message #1709150 is a reply to message #1708981] Thu, 24 September 2015 13:25 Go to previous messageGo to next message
Jeevak Gajbhiye is currently offline Jeevak GajbhiyeFriend
Messages: 1
Registered: September 2015
Junior Member
Thanks for the help. I was looking for this type of conversion
Re: JSON string to structured data type conversion. [message #1709154 is a reply to message #1709127] Thu, 24 September 2015 13:31 Go to previous message
Ts Patil is currently offline Ts PatilFriend
Messages: 32
Registered: September 2015
Member

Thanks Ashish Khole, Vikram

It worked for me.

[Updated on: Thu, 24 September 2015 13:32]

Report message to a moderator

Previous Topic:Multi model audit trail setup
Next Topic:[File missing] Camel Route to Send and Receive Email
Goto Forum:
  


Current Time: Wed Apr 24 16:00:46 GMT 2024

Powered by FUDForum. Page generated in 0.02666 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top