Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am working with Talend I have received the task to make a route
This route should take data from an api and put the result on a queue .
I have issues with the request to have 2 validations of data posted on api
A collegue suggest to use regular expresions and I found this expresion ^[0-9]+(,[0-9]+)*$ for doing the first demand but I do not know how to use it in my route .
I use cREST and I do not know where to put this expresion for doing validation.
Can you help me?
Thanks,
Aurel
If you want to carry out complicated manipulations of data inside a Route, you can make use of a Talend Job with a cTalendJob component. This will allow you to build a Talend Job and have it used inside the Route. This documentation talks you through a basic example....
https://help.talend.com/r/en-US/8.0/route/ctalendjob-standard-properties
Hi, As said before the job is the easiest way to manipulate data. If you want to do it inside the route, you can filter message inside a route with "cMessageFilter". So if you message must only have comma and number, you could use Simple language to do it inside the component cMessageFilter. It will be something like "${in.body} !regex [^\d,]" if it matches it means that you don't have something else than number and comma. I didn't test the solution, it's just an insight.
For the second maybe trying a split and count in simple ? And then do on it a less than ?
You have all the documentation for simple languages here :
https://camel.apache.org/components/3.18.x/languages/simple-language.html
And here how cMessageFilter works :
https://help.talend.com/r/en-US/8.0/filter/cmessagefilter-standard-properties
Have a nice day and good luck ,