on 04-19-2016 5:52 AM
Hi All,
I have defined a integer type import parameter and please advice me how to retrieve the parameter and use it in mapping as source field.
Hi Vinoth,
Use below UDF:
public String getInputParam(String input, Container container) throws StreamTransformationException {
return Integer.toString(container.getInputParameters().getInt("test"));
}
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here are two other alternatives:-
i) Define a normal input argument, and then pass in a Constant value. In the constant selection, you can choose the defined parameter using the Input help.
ii) Instead of using an input argument, define the input as a Parameter instead to the UDF.
When configuring the UDF, you can double click it to set the Parameter value, and here again you can choose the mapping parameter from the Input help.
With either of these approaches, you can perform a Where Used list on the parameter to know where it is used. If you directly access it using coding via container, you cannot trace a where use on a parameter.
Message was edited by: Eng Swee Yeoh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With this approach, you can see if a parameter is being actively used in anywhere in the mapping object - there will be a tiny red triangle next to the parameter
And if you try to delete a used parameter, there will be a warning prompt.
This will provide an in-built check should you or some other developer mistakenly delete a parameter.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.