Forum Discussion
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.
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?
- nganapathiraju8 years agoFormer Employee
Yes definitely. It should!!
- krupalibshah8 years agoContributor
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.
- del8 years agoContributor III
@krupalibshah, I think the eval() function is what you’re looking for. See if the following additions to your mapper help point you in the right direction.
- krupalibshah8 years agoContributor
Can you give me an example?
- nganapathiraju8 years agoFormer Employee
Here is what works.
eval-pipeline-params_2017_11_13.slp (3.3 KB)