how to add extra column from an existing .text file in wso2 esb? - wso2-esb

I have Input.text file which has following values
**SNO|FIRSTNAME|LASTNAME|EMAIL|PHONE|ADDRESS|SELLING_DEALER**
**51|chris|clark|cpar#hotmail.com|0406-755789|Australia|MB MacGregor**
I have done some operation like phone validation or email validation.After performing that,need to write output file which has following values if phonevalidation gets successed.
**SNO|FIRSTNAME|LASTNAME|EMAIL|PHONE|ADDRESS|SELLING_DEALER|PHONEVALIDATION**
**51|chris|clark|cpar#hotmail.com|0406-755789|Australia|MB MacGregor|yes**
Otherwise(if phonevalidation gets failed)
**SNO|FIRSTNAME|LASTNAME|EMAIL|PHONE|ADDRESS|SELLING_DEALER|PHONEVALIDATION**
**51|chris|clark|cpar#hotmail.com|0406-755789|Australia|MB MacGregor|No**
Hope you understood my question!
Anyone please help me out to find solution,
Awaiting for your response

Try this. Depending on PHONEVALIDATION, you can route the payload using Router Mediator and later on enrich youy payload using Enrich Mediator.
How to enrich payload take a look this post (https://dzone.com/articles/wso2-esb-enrich-mediator-fast)
Hope this helps

Related

attributes.headers getting lost after a http Request call in Mulesoft?

I am getting some attributes in an API but all getting lost after an HTTP request connector in mule4.
why is it happening?
Look in the connector's configuration properties -> advanced tab for the connector configuration (in this case the HTTP connector's "request" operation) and you'll find a target variable and target value. If you fill in the target with a name - this does an enrichment to avoid overwriting the Mule message. If you leave it blank (the default) it will save the message (attributes, payload) over the top of the existing one - which is what you're seeing now. This mirrors the old mule 3 functionality, but sometimes you want it to leave what you have there alone.
So for the target value you get to pick exactly what gets saved.. If you want just payload: put that in. If you want both payload and attributes - I'd use "message" as that will mean you get both payload and attributes saved in the variable. Of course you may not want as much saved, so feel free to put in whatever dataweave expression you like - so you could even create something with bits from anywhere like:
{
statusCode: attributes.statusCode,
headers: attributes.headers,
payload: payload
}
A connector operation may replace the attributes with those of the operation. If you need to preserve the previous attributes you need to save them to a variable.
This is a default behaviour of MuleSoft. Whenever request crosses to transport barrier it losses existing attributes. You need to preserve attribute before HTTP Request.

payload changing to com.mulesoft.weave.reader.DefaultSeekableStream (Mule 3)

Payload in muleflow is getting converted in com.mulesoft.weave.reader.DefaultSeekableStream from org.glassfish.grizzly.utils.BufferInputStream. I am not sure why and due to this the subsequent activities (dw transformer) is failed. Anyone have any idea what could be the reason and how to overcome this.
The payload is pretty simple and I am trying to use two transformation activity, In first activity I parse the payload and create a flowVariable and in second transformation is to add values in payload. However, after first transformation the payload is changed to DefaultSeekableStream.
Thanks,
Abhi
Error message:

Unable to upload multipart file in karate, Required request part '' not present

ActualAPIRequest OutputFromKarate
Trying to upload a json file for an api using karate. Since api takes multipart input i am passing multipart configurations in karate.
But Required request part 'inputData' not present error is coming. Is there any solution for this please?
I have attached actual input and result from karate screenshot for reference
Just make sure that the data type of inputData and maybe swaggerFile is JSON. Looks like you are sending a string.
Please refer to this section of the doc: https://github.com/intuit/karate#type-conversion
If the server does not like the charset being sent for each multipart, try * configure charset = null

Failed to respond to incoming message using data source row correlation

I am totally new to Parasoft virtualize. I created a virtual asset and added three fields in my data source correlation, My request xml has 4 fields. I am getting this error after processing the request.
<Reason>Failed to respond to incoming message using data source row correlation</Reason>
<Details>Values in incoming message did not match values in the data source "GetSubscriptionOperationsRequest"</Details>
Any suggestions on what might be the problem here?
The message which you are getting explains your problem.
The virtual asset cannot correlate your request with data in your data source to build response.
Try to send request with one of the values from column used for Datasource's corelation in your responder.
That value should be in request's filed used by correlation.
Maybe you should try to add catch all responder to see if you have correct corelation between incoming requests and your responder.
You can also ask Parasoft's technical support for help.

Set variable session copyonwritearraylist

Im new on Mule ESB and i have the next problem. I use connector "Collection Splitter" to separate a list of orders (books) to other things. When i do the checks i go back to join the books on the order with connector "Collection Agreggator". What i want is save the information of the payload in that moment in a session variable. The system dont do that. I think is posible because the type saves on the payload is "CopyOnWriteArrayList" type and i dont now if is posible save this type of list in a session variable.
Someone can be help me please?
Thanks!
You can also use a set-session-variable transformer. Set the name is something of your choosing and set the value to be #[payload]. That you will maintain both your payload and have a new session variable. However be very careful when using session variables, since these are serialized when sending a Mule message over a transport. If possible, try to use flow variables.
use the message enricher scope to achieve the same.
define the required component inside the message enricher scope.
in the enricher scope specify source as payload and the target as session variable.
try and let me know the status.