Skip to main content



      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 02:38 Go to next message
Eclipse UserFriend
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 03:06 Go to previous messageGo to next message
Eclipse UserFriend
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 05:43 Go to previous messageGo to next message
Eclipse UserFriend
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 05:45] by Moderator

Re: JSON string to structured data type conversion. [message #1709150 is a reply to message #1708981] Thu, 24 September 2015 09:25 Go to previous messageGo to next message
Eclipse UserFriend
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 09:31 Go to previous message
Eclipse UserFriend

Thanks Ashish Khole, Vikram

It worked for me.

[Updated on: Thu, 24 September 2015 09:32] by Moderator

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


Current Time: Sun Jun 15 08:58:26 EDT 2025

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

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

Back to the top