Author Message
KatalinOrbán
Joined: Jan 13, 2017
Messages: 25
Offline
Hi all,

I bumped into another issue in ED.

Fact:
JSON.stringify does not work properly in ED.
Even if the original JSON.stringify JavaScript method is working fine in this case

Details:
In case of converting a multiple objects which contain only one item to JSON with JSON.stringify
this multiple objects with one element will show up in the JSON as a simple string instead of one element array.
( "Service" : "ServiceValue" instead of "Service":["ServiceValue"] )

Sample attached: JSONStringifyOneItemInMultiple.xml
Screenshot about the result attached: JSONStringifyIssue.jpg

AED version: 3.2.0.1.00013

Kind regards:
Katalin Orban
  • [Thumb - JSONStringifyIssue.jpg]
[Disk] Download
Filename JSONStringifyOneItemInMultiple.xml [Disk] Download
PrakashN
Joined: Jun 30, 2015
Messages: 105
Offline
Kata,

Thanks for posting this question in this forum here. I pulled your workflow from the question, deployed and executed. I got this after the JSON Stringify task:

2017-01-25 10:13:20,828 [WebContainer : 4] EngagementDesigner FINE - EngagementDesigner-3.2.2.0.715119 - starting data mapper: [associations] [ContextStore:uuid907e7f36_c4ee_8a97_e1d2_1485190677806:ContextStoreJSON:uuid97868095_5462_3335_96bd_1485344707942:[.:CSJSON:{"range":[0,57],"type":"CallExpression","callee":{"range":[0,14],"type":"MemberExpression","computed":false,"object":{"range":[0,4],"type":"Identifier","name":"JSON"},"property":{"range":[5,14],"type":"Identifier","name":"stringify"}},"arguments":[{"range":[15,56],"type":"Identifier","name":"uuid907e7f36_c4ee_8a97_e1d2_1485190677806"}]}]][lvars][out.put:{"outputString":"tmp","outputInt":1}, uuid97868095_5462_3335_96bd_1485344707942:{}, uuid12345678901234567890:{"wfdVersion":"1","instanceId":"301","securityIP":"10.129.177.184","wfdName":"test11"}, uuid907e7f36_c4ee_8a97_e1d2_1485190677806:{"csDataInput":{"contextId":"temptestContextId","data":{"ServiceMap":{"1":{"priority":"5","attributes":{"Service":[null],"Channel":[null],"Location":[null],"Language":[null]}}}}}}, uuidProperties1234567890:{}][rvars][uuid97868095_5462_3335_96bd_1485344707942:{}, uuid12345678901234567890:{"wfdVersion":"1","instanceId":"301","securityIP":"10.129.177.184","wfdName":"test11"}, uuid907e7f36_c4ee_8a97_e1d2_1485190677806:{"csDataInput":{"contextId":"temptestContextId","data":{"ServiceMap":{"1":{"priority":"5","attributes":{"Service":[null],"Channel":[null],"Location":[null],"Language":[null]}}}}}}, uuidProperties1234567890:{}]

As you can see above, the ServiceMap gets an array. It is getting a null because I dont have a value for your property there, but, it is an array containing a single null. So may be there is something wrong on your side... We can troubleshoot in a live session if you like.

Thanks!

Prakash Natarajan System Architecture Consulting Engineer Engagement Designer Avaya
KatalinOrbán
Joined: Jan 13, 2017
Messages: 25
Offline
Thank you Prakash!

I really appreciate your help on this!

I have just tried it with empty values like you and I got this:
"ServiceMap":{
"1":{
"resourceCount":0,
"rank":0,
"maxProficiency":0,
"priority":"5",
"attributes":{
"Service":"",
"Channel":"",
"Location":"",
"Language":""
},
"minProficiency":0
}
- still no arrays in the json.

I would be really happy if we could schedule a live session!
Which time is the most suitable for you?

I am in Budapest, Hungary, UTC+1.

Thank you in advance!
K.
AnuragAggarwal
Joined: Jun 1, 2014
Messages: 154
Offline
This is also related to other issue (array append vs ovrwrite). ED had issue and it created in this case single string (instead of array with single string s it should have). Thereafter jsn.stringify though itself worked ok - produced bad output (as input to it was bad)

Thsi has been fixed on Dec 15, 2016 as well (not released)

I ran on recent ED code, and please see screenshot ere arrays are produced ok by json.stringify
  • [Thumb - Json_array.png]
[Disk] Download
KatalinOrbán
Joined: Jan 13, 2017
Messages: 25
Offline
Thx Anurag!

If I understood it well both of the JSON stringify issue and the assigning more object to the list are known issue
and those were fixed but not released.

Is it possible to get these fixes as soon as possible or we have to wait until the release?

I am working on a high priority customer project and we need these to work today or on next Monday.

Thank you for your help and the information!

Kind regards:
katalin Orban
korban@avaya.com
AnuragAggarwal
Joined: Jun 1, 2014
Messages: 154
Offline
yes these are fixed and no released

you would have to escalate with Vishal/Eli etc to get a release based on these fixes, they are more involved with release management
PrakashN
Joined: Jun 30, 2015
Messages: 105
Offline
Kata,

I think this explains why it was working right for me when I tested with your workflow as I was working with the latest code base. We will have this fix in 3.2.2 of ED/Oceana release which will be available by end of March. If you can't wait until then, please let us know and we will see if we can escalate this process and get the fixes to you.

Thanks!

Prakash Natarajan System Architecture Consulting Engineer Engagement Designer Avaya
Go to:   
Mobile view