Infinity: Parsing Complex XML Tree with Subtree by new value - no data

hello together,
I have a issue with my XML Response.

Response looking like this and by first call I get my wished value. But by next value in Subtree, I get no Data.

<?xml version="1.0"?>
<methodResponse>
    <params>
        <param>
        <value>
            <struct>
                <member>
                    <name>agentsLiveData</name>
                    <value>
                        <struct>
                            <member>
                                <name>731</name>
                                <value>
                                    <struct>
                                        <member>
                                            <name>AgentPhoneState</name>
                                            <value>
                                                <string>RINGING</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentGroupState</name>
                                            <value>
                                                <string>ACTIVE</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentId</name>
                                            <value>
                                                <string>731</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentName</name>
                                            <value>
                                                <string>Username1</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentUserState</name>
                                            <value>
                                                <string>UNAVAILABLE</string>
                                            </value>
                                        </member>
                                    </struct>
                                </value>
                            </member>
                            <member>
                                <name>711</name>
                                <value>
                                    <struct>
                                        <member>
                                            <name>AgentPhoneState</name>
                                            <value>
                                                <string>AVAILABLE</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentGroupState</name>
                                            <value>
                                                <string>ACTIVE</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentId</name>
                                            <value>
                                                <string>711</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentName</name>
                                            <value>
                                                <string>Username2</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentUserState</name>
                                            <value>
                                                <string>AVAILABLE</string>
                                            </value>
                                        </member>
                                    </struct>
                                </value>
                            </member>
                            <member>
                                <name>726</name>
                                <value>
                                    <struct>
                                        <member>
                                            <name>AgentPhoneState</name>
                                            <value>
                                                <string>RINGING</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentGroupState</name>
                                            <value>
                                                <string>ACTIVE</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentId</name>
                                            <value>
                                                <string>726</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentName</name>
                                            <value>
                                                <string>Username3</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentUserState</name>
                                            <value>
                                                <string>UNAVAILABLE</string>
                                            </value>
                                        </member>
                                    </struct>
                                </value>
                            </member>
                            <member>
                                <name>728</name>
                                <value>
                                    <struct>
                                        <member>
                                            <name>AgentPhoneState</name>
                                            <value>
                                                <string>AVAILABLE</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentGroupState</name>
                                            <value>
                                                <string>INACTIVE</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentId</name>
                                            <value>
                                                <string>728</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentName</name>
                                            <value>
                                                <string>Username4</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentUserState</name>
                                            <value>
                                                <string>AVAILABLE</string>
                                            </value>
                                        </member>
                                    </struct>
                                </value>
                            </member>
                            <member>
                                <name>718</name>
                                <value>
                                    <struct>
                                        <member>
                                            <name>AgentPhoneState</name>
                                            <value>
                                                <string>RINGING</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentGroupState</name>
                                            <value>
                                                <string>ACTIVE</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentId</name>
                                            <value>
                                                <string>718</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentName</name>
                                            <value>
                                                <string>Username5</string>
                                            </value>
                                        </member>
                                        <member>
                                            <name>AgentUserState</name>
                                            <value>
                                                <string>UNAVAILABLE</string>
                                            </value>
                                        </member>
                                    </struct>
                                </value>
                            </member>
                        </struct>
                    </value>
                </member>
                <member>
                    <name>callersLiveData</name>
                    <value>
                        <array><data><value><struct><member><name>CallerChannel</name><value><string>SIP/1420101905-0000032d</string></value></member><member><name>CallerState</name><value><string>ringing</string></value></member><member><name>CallerTime</name><value><string>17123456789</string></value></member><member><name>CallerPosition</name><value><int>1</int></value></member><member><name>CallerPriority</name><value><int>0</int></value></member><member><name>AgentId</name><value><string></string></value></member><member><name>AgentName</name><value><string></string></value></member><member><name>CallerName</name><value><string>Hotline Group : 0001333444555666 Customer1)</string></value></member><member><name>CallerId</name><value><string>2f1f6cf1-41c2-4d71-8d94-ec8ebc164bd4</string></value></member><member><name>CallerNumber</name><value><string>15123456789</string></value></member></struct></value><value><struct><member><name>CallerChannel</name><value><string>SIP/1420101905-00000340</string></value></member><member><name>CallerState</name><value><string>waiting</string></value></member><member><name>CallerTime</name><value><string>17123456789</string></value></member><member><name>CallerPosition</name><value><int>2</int></value></member><member><name>CallerPriority</name><value><int>0</int></value></member><member><name>AgentId</name><value><string></string></value></member><member><name>AgentName</name><value><string></string></value></member><member><name>CallerName</name><value><string>Hotline Group : 0001333444555666 Customer2</string></value></member><member><name>CallerId</name><value><string>d24d3077-e217-4e5f-a873-e3579aa4b7d3</string></value></member><member><name>CallerNumber</name><value><string>00491523456789</string></value></member></struct></value></data></array>
                    </value>
                </member>
                <member>
                    <name>groupId</name>
                    <value>
                        <string>98358</string>
                    </value>
                </member>
            </struct>
        </value>
        </param>
    </params>
</methodResponse>

in tree:

I filtering by “CallerState” - Value (ringing or waiting)

phenomen is in Table by 2 calls all Data in Parsing structure I got no data. The first also disapear…

My Parsing Options looking like this:

Rows/Root : callersLiveData
methodResponse.params.param.value.struct.member.1.value.array.data
Selector: value.struct.member.1.value.string -> ALIAS: CallerState -> formated as: String
Selector: value.struct.member.8.value.string -> ALIAS: CallerId -> formated as: String

In complete Tree I see, that I get after the Root:



methodResponse.params.param.value.struct.member.1.value.array.data

to new Trees: with value

I found my issue. It looks like a Bug from Infinity.

Correct Rows/Root is:

methodResponse.params.param.value.struct.member.1.value.array.data.value

and Columns for example CallerState.

struct.member.1.value.string

Its Working now. But I got a Error from Grafhana - Plugin Error 500

Object
status:500
statusText:"Internal Server Error"
data:Object
message:"An error occurred within the plugin"
messageId:"plugin.downstreamError"
statusCode:500
traceID:""
config:Object
url:"api/ds/query?ds_type=yesoreyeram-infinity-datasource&requestId=Q9797"
method:"POST"
data:Object
requestId:"Q9797"
hideFromInspector:false
headers:Object
retry:0
traceId:undefined
message:"An error occurred within the plugin"

No it is not bug in infinity imo. your xml data structure is extremely complicated and very non standard.

After this section methodResponse.params.param.value.struct.member

the data is no longer xml it is json

{
	"struct": {
		"member": [
			{
				"name": 731,
				"value": {
					"struct": {
						"member": [
							{
								"name": "AgentPhoneState",
								"value": {
									"string": "RINGING"
								}
							},
							{
								"name": "AgentGroupState",
								"value": {
									"string": "ACTIVE"
								}
							},
							{
								"name": "AgentId",
								"value": {
									"string": 731
								}
							},

until you sort that out for the data either to be xml or json, it is very hard to parse it.

even if you want to further parse the data using json parsing methods, it gets complicated in the json data portion itself.

here for example

"name": "AgentId",
"value": {"string": 731}

standard json should be key, value (in most cases) but this one further breaks down the value portion and tacks on a data type and uses the data type as the identifier of the value "string": 731, very strange.

ok, I understand. I was also very surprised to see it like that and very unstructured. Are there any suggestions for improvement or how this can be done differently or better?

do you have control over the structure of the xml, how it is generated?

recommended xml structure, should be self documenting, common sense, understandable by a person that is seeing an xml doc for the first time in their life

<?xml version='1.0' encoding='UTF-8'?>
<agents>
  <agent>
    <AgentId>1</AgentId>a
    <AgentName>Janey Tesseyman</AgentName>
    <AgentPhoneState>RINGING</AgentPhoneState>
    <AgentGroupState>ACTIVE</AgentGroupState>
    <AgentUserState>UNAVAILABLE</AgentUserState>
  </agent>
  <agent>
    <AgentId>2</AgentId>
    <AgentName>Hazel Dunsire</AgentName>
   <AgentPhoneState>OFF</AgentPhoneState>
    <AgentGroupState>OFF</AgentGroupState>
    <AgentUserState>AVAILABLE</AgentUserState>
  </agent>
  <agent>
    <AgentId>3</AgentId>
    <AgentName>Adina Odgers</AgentName>
  <AgentPhoneState>UNHOOKED</AgentPhoneState>
    <AgentGroupState>LUNCH</AgentGroupState>
    <AgentUserState>AVAILABLE</AgentUserState>
  </agent>
  <agent>
    <AgentId>4</AgentId>
    <AgentName>Mac Deverson</AgentName>
   <AgentPhoneState>OUTTHEWINDOW</AgentPhoneState>
    <AgentGroupState>OFF</AgentGroupState>
    <AgentUserState>AVAILABLE</AgentUserState>
  </agent>
</agents>

actually, I was wrong, it does look like there might be a bug in Infinity @yesoreyeram

the plugin is the issue that it changes things to json?

I would submit a bug report to github for this plugin

thanks! I also opened a case: