ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportJSON Nested Arrays in ESQL

Post new topicReply to topic
JSON Nested Arrays in ESQL View previous topic :: View next topic
Author Message
soudhanya
PostPosted: Mon Oct 01, 2018 6:02 am Post subject: JSON Nested Arrays in ESQL Reply with quote

Novice

Joined: 27 Feb 2017
Posts: 13

Hi,

Can some one help me how to create nested Arrays..

Here is the JSON message:


{"name": "DiwRule3", "contactFilterRules": [
{
"contactFieldId": 16,
"type": "SYSTEM_ARRAY",
"operator": "IN",
"dataType": "NUMBER",
"columnName": "groups",
"contactFilterOption": "IN",
"columnValue": [
8105621194808290, 8105621194808291
]
}]
}


I had a hard time to create ColumnValue array
here is my ESQL:

SET OutputRoot.JSON.Data.name = UPPER(Environment.DFDL.ns:ContactEmployeeDetails.Group);
CREATE FIELD OutputRoot.JSON.Data.contactFilterRules IDENTITY(JSON.Array)contactFilterRules;
SET OutputRoot.JSON.Data.contactFilterRules.Item[1].contactFieldId = '16';
SET OutputRoot.JSON.Data.contactFilterRules.Item[1].type = 'SYSTEM_ARRAY';
SET OutputRoot.JSON.Data.contactFilterRules.Item[1].operator = 'IN';
SET OutputRoot.JSON.Data.contactFilterRules.Item[1].dataType = 'NUMBER';
SET OutputRoot.JSON.Data.contactFilterRules.Item[1].columnName = 'groups';
SET OutputRoot.JSON.Data.contactFilterRules.Item[1].contactFilterOption = 'IN';


How to write logic for Column Value..? Please help.

Thanks,
Soudhanya
Back to top
View user's profile Send private message Send e-mail
timber
PostPosted: Tue Oct 02, 2018 6:30 am Post subject: Reply with quote

Sentinel

Joined: 25 Aug 2015
Posts: 855

There's a standard approach for this sort of thing:
1. Create the JSON message that you want IIB to write
2. Add a Trace node to your message flow. Set the Pattern property to ${Root}
3. Parse the JSON message
4. Inspect the Trace node output
5. Modify your ESQL until the message tree that you send to the output node looks exactly like the message tree produced by the JSON parser
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportJSON Nested Arrays in ESQL
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.