11-09-2017 02:11 AM
I am trying to see if I can retrieve the payload when a pipeline is exposed as a task?
Example:
Payload : 10
Pipeline parameter:
p = /a/b OR $.a.b
I want ‘p’ to take the value as 10 (in this case) and show up under pipeline parameter when ‘capture’ is enabled.
Is this supported? If yes, how?
11-09-2017 08:57 AM
You cannot set the parameters values once inside the pipeline. They are ready-only.
You can set them only from outside passing values to them either externally or from a different pipeline.
11-09-2017 09:12 AM
Yeah, I got that.
What I am trying to do is if the parameter is given an expression will it evaluate it?
If we give an xpath or json path (whose value will be in the document that the pipeline receives) will the xpath be populated with correct values?
11-09-2017 09:33 AM
Yes definitely. It should!!
11-09-2017 08:08 PM
I made this simple pipeline to test,
input :
{
"firstName": "John",
"lastName" : "doe",
"age" : 26,
"address" : {
"streetAddress": "naist street",
"city" : "Nara",
"postalCode" : "630-0192"
},
"phoneNumbers": [
{
"type" : "iPhone",
"number": "0123-4567-8888"
},
{
"type" : "home",
"number": "0123-4567-8910"
}
]
}
the response I get is,
[{
"firstName": "John",
"lastName": "doe",
"age": 26,
"address": {
"streetAddress": "naist street",
"city": "Nara",
"postalCode": "630-0192"
},
"phoneNumbers": [
{
"type": "iPhone",
"number": "0123-4567-8888"
},
{
"type": "home",
"number": "0123-4567-8910"
}
],
"a": {
"a": "pipe.label",
"payload1": "$",
"REMOTE_ADDR": "35.156.60.10",
"xpath_city": "/root/address/city",
"HTTP_DATE": "",
"REMOTE_USER": "",
"HTTP_REFERER": "",
"REMOTE_PORT": "",
"QUERY_STRING": "",
"payload": "$",
"CONTENT_TYPE": "application/json",
"HTTP_ACCEPT": "",
"REQUEST_METHOD": "POST",
"jsonpath": "$.address.city",
"HTTP_USER_AGENT": "Apache-HttpClient/4.1.1 (java 1.5)",
"HTTP_ACCEPT_ENCODING": "",
"PATH_INFO": ""
},
"b": false
}]
TestParam_2017_11_10.slp (2.5 KB)
The xpath or json path are not getting evaluated.