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. 

 

 

11 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".