How to edit the java Code

One Star

How to edit the java Code

Hi all,
Could u all tell me how to edit the code generated by Talend Tool .
I m using java as a language.
Thanks in Advance.
One Star

Re: How to edit the java Code

Hi,
Go to the jobDesigner window. you can see two sheets: designer and Code.
Cick on "Code" and the select all, and Copy/paste in notepad++ for example.
Hope this can help.
Cheers.
One Star

Re: How to edit the java Code

Hi driss,

problem is how one can use the edited code back in job designer..
i mean cant make the changes in code viewer..
or once u make changes after copyiny to notepad ,how will u paste the updated code back to code viewer in order to work the jobas per ur requirement.
Thanks,
One Star

Re: How to edit the java Code

Hello

I will be able to find your information in

.........\workspace\.Java\src\<projectname>\<Jobname>\xxx.java
Employee

Re: How to edit the java Code

Hello,
You can export your job (use right-click on your job, choose "Export job scripts"), and then check the option "Source files".
In the exported package, you will have : Library, Class code (in a jar File), and Source Code (in Java file), context property files, etc...
Regards.
One Star

Re: How to edit the java Code

Hi Musharraf,
if you would like to use Talend and own java-code together, you can use the special tJava*-modules.
Alternative to change existing modules you have to edit the jet-files for the code generator. You can find this files here:
\plugins\org.talend.designer.components.localprovider_???\components\
I do this to add additional options for my connection to oracle, which are not provided by talend itself. The problem ist, that you have to do this changes every time again if you upgrade to a new version of Talend.
If you export the code (copy/paste or with talend export-functionality) and edit it you can't use talend any more or have to do your changes on every export again.
I hope this is the information you are searching for.
By Volker
One Star

Re: How to edit the java Code

Hi
  I am getting syntax error in "MS positional File" and I have no idea why this error is occurring. can I get some help to solve this problem...
Moderator

Re: How to edit the java Code

Hi sivakumar.n,
What's the error message you are getting? Could you please give us more information about your current job?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: How to edit the java Code

I want to create a dynamic json structure in my job as follows
1. Sheet used for data import has number of fields
2. Fields are then mapped to become part of json tree structure
3. I want that, if a field has no data it should not form part of tree node..
    For eg:-
    org.dom4j.Element root_0_0_5_tWriteJSONField_1_Out = root_0_0_tWriteJSONField_1_Out
     .addElement("organizationEmployeeTelephone");
    org.dom4j.Element root_0_0_5_0_tWriteJSONField_1_Out = root_0_0_5_tWriteJSONField_1_Out
     .addElement("A");
 
 if (valueMap_tWriteJSONField_1_Out.get("home_phone") != null) {nestXMLTool_tWriteJSONField_1_Out                                                    .setText(root_0_0_5_0_1_tWriteJSONField_1_Out,valueMap_tWriteJSONField_1_Out                                                                    .get("home_phone"));
                                        }
That is, I want to place this if condition above the component creation "org.dom4j.Element" step. So that it could check if home_phose has no value then, .addElement("A") won't happen.
I have tried editing the java code. But each time I open the job designer, the code gets reverted. I am told by support that editing can be done via jobscript. But jobscript module doesnot have any if condition implemention way
Thanks
Harsimran
One Star

Re: How to edit the java Code

Hello,
When I was trying to edit my profile name I 'm not able delete the existing profile name. It is prompting me to press alt + back space. Still it is not working
Thanks,
Smitha