Six Stars

whenever build the job changes are rollback.

Hello,

I opened the job in "java editor" and edit the some specific code and build the job.
So after build the job my changes are roll backed and its not displayed my changes too. 

 

 

17 REPLIES
Moderator

Re: whenever build the job changes are rollback.

Hi,

You cannot directly edit the code generated for a Talend Job.

If you want to include your own Java code in a Job, use one of these methods:

  • Use a tJava, tJavaRow, or tJavaFlex component.
  • Create a routine by right-clicking Routines under Code in the Repository and then clicking Create routine.

Let us know if it is OK with you.

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.
Six Stars

Re: whenever build the job changes are rollback.

Okay.


Can you please explain me how to use these components which you mentioned in your post.

And If I create custom routine then how will it point to my job in which I want to edit or modify the code.

Moderator

Re: whenever build the job changes are rollback.

Hello,

Please have a look at related component references about:TalendHelpCenter:tJava, TalendHelpCenter:tJavaRow and TalendHelpCenter:tJavaFlex

TalendHelpCenter: Differences between tJava, tJavaRow and tJavaFlex

If you are creating a custom routine to include your own java code in job, you can call a routine from a job. Please refer to this document:TalendHelpCenter:Calling a routine from a 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.
Six Stars

Re: whenever build the job changes are rollback.

I checked these documents but I want to just add the one more field into the code which is reflected in database too.

I just wanted to add one String datatype field in my Job files. And then set its getter and setter method.

This task is very small and you suggest is very bigger then my task.

So can you please help me out to solve this issue.
Moderator

Re: whenever build the job changes are rollback.

Hello,

For your job requirement, could you please set an example for us? Are you referring to data mapping between Talend type and db type?

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.
Moderator

Re: whenever build the job changes are rollback.

Hello,

If you want to change the default data type mapping.

Please have a look at this document https://community.talend.com/t5/Migration-Configuration-and/Changing-the-default-data-type-mapping/t...

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.
Six Stars

Re: whenever build the job changes are rollback.

public String Current_Sales_Rep_Name;

		public String getCurrent_Sales_Rep_Name() {
			return this.Current_Sales_Rep_Name;
		}

		public String Delivery_Status_Desc;

		public String getDelivery_Status_Desc() {
			return this.Delivery_Status_Desc;
		}

		public String Sold_to_Party_Nbr;

		public String getSold_to_Party_Nbr() {
			return this.Sold_to_Party_Nbr;
		}

		public String Sold_to_Party_Name;

		public String getSold_to_Party_Name() {
			return this.Sold_to_Party_Name;
		}

		public java.util.Date Bill_Posting_Date;

		public java.util.Date getBill_Posting_Date() {
			return this.Bill_Posting_Date;
		}

		public String Sales_Nbr;

		public String getSales_Nbr() {
			return this.Sales_Nbr;
		}

		public String Shipped_Merchandise_Value;

		public String getShipped_Merchandise_Value() {
			return this.Shipped_Merchandise_Value;
		}

I just want to add one new field named "Billing Number". and set its getter method. Nothing else.

Moderator

Re: whenever build the job changes are rollback.

Hi,

Have you tried to achieve your goal by using custom code component tJavaRow?  Which allows you to enter the Java code to be applied to each row of the flow.

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.
Six Stars

Re: whenever build the job changes are rollback.

Not yet. But I will try it now.
Can you please give me the tJavaRow component download link ? Or any other way to install or add this component in the project ?

Moderator

Re: whenever build the job changes are rollback.

Hello,

The Standard tJavaRow component belongs to the Custom Code family which in this framework is generally available.

You can get it from palette in studio.

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.
Six Stars

Re: whenever build the job changes are rollback.

I added the tJavaRow custom component into the project.
And also added in my design structure.
But when I wrote the code

public String Billing_Nbr;

		public String getBilling_Nbr() {
			return this.Billing_Nbr;
		}

I am getting error that "Illegal modifier for the variable Billing_Nbr; only final is permitted".

 

Six Stars

Re: whenever build the job changes are rollback.

is there any solution for my question ?
I am waiting for the answer and any relevant help which is useful to solve this issue.

Six Stars

Re: whenever build the job changes are rollback.

I added Biling_Nbr variable using the map component and added in the code.

Screenshot from 2017 12 22 03 31 07.png

 

So while saving this it's required to add generic and I added generic as "Smartwool_Hiten" and then again added this variable in update invoice and they again asked to add the generic.

So is it possible to use the same generic which is used previously or must add new generic ?
And where this generic store in the file system because I tried to find "Smartwool_Hiten" generic but I can't get it where it stored.

Moderator

Re: whenever build the job changes are rollback.

Hello,

It is a little hard for us to address your issue from screenshot. It looks like a complicated job. Could you please indicate which talend build version you are using? Open studio or subscription solution? Would you mind sending your job to us for a further testing?

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.
Six Stars

Re: whenever build the job changes are rollback.

I am using Talend Open Studio for Data Integration (6.2.2).
Community Manager

Re: whenever build the job changes are rollback.

Hi hitenz_zaptech
Talend Studio is a code generator based on the component GUI, the change on generated code are invalid and will be rollback once you return back to the job design. So, if you want to add a new field to the data flow, back to job design and add a new column in the output table on tJavaRow or tMap.

For the error on your screenshot, this is because the same item name already exits, choose another name or clean the recycle bin and try it again.

Regards
Shong

----------------------------------------------------------
Talend | Data Agility for Modern Business
Six Stars

Re: whenever build the job changes are rollback.

Yes, I got it.

And I am editing the code in custom component like tMap and tJava.